Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24316
Modified Files:
basics.h configure configure.py wolfpack.pro
Log Message:
Some improvements and cleanups
Index: basics.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basics.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** basics.h 19 Aug 2004 05:28:21 -0000 1.30
--- basics.h 19 Aug 2004 05:29:06 -0000 1.31
***************
*** 305,306 ****
--- 305,307 ----
#endif
+
Index: wolfpack.pro
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v
retrieving revision 1.205
retrieving revision 1.206
diff -C2 -d -r1.205 -r1.206
*** wolfpack.pro 5 Aug 2004 21:36:37 -0000 1.205
--- wolfpack.pro 19 Aug 2004 05:29:06 -0000 1.206
***************
*** 6,11 ****
#################################################################
- include( config.pri )
-
PROJECT = wolfpack
TARGET = wolfpack
--- 6,9 ----
***************
*** 19,126 ****
CONFIG += console
! # Common unix settings
! # Lets try to figure some paths
! # Checking in /usr first, then /usr/local
! # This will use custom installs over package installs.
!
!
! # MySQL Checks
! mysql {
! isEmpty( MySQL_INCDIR ) {
! message( "Warning: MySQL_INCDIR was not defined!" )
! exists( /usr/local/include/mysql/mysql.h ) {
! message( "MySQL included found in: /usr/local/include/mysql" )
! MySQL_INCDIR = /usr/local/include/mysql
! }
! else:exists( /usr/include/mysql/mysql.h ) {
! message( "MySQL included found in: /usr/include/mysql" )
! MySQL_INCDIR = /usr/include/mysql
! }
! }
! isEmpty( MySQL_LIBDIR ) {
! message( "Warning: MySQL_LIBDIR was not defined!" )
! exists( /usr/local/lib/mysql/libmysqlclient.so ) {
! message( "Found libmysqlclient.so in: /usr/local/lib/mysql" )
! MySQL_LIBDIR = -L/usr/local/lib/mysql -lmysqlclient
! }
! else:exists( /usr/lib/mysql/libmysqlclient.so ) {
! message( "Found libmysqlclient.so in: /usr/lib/mysql" )
! MySQL_LIBDIR = -L/usr/lib/mysql -lmysqlclient
! }
! }
! }
!
! # SQLite Checks
! sqlite {
! isEmpty( SQLite_INCDIR ) {
! message( "Warning: SQLite_INCDIR was not defined!" )
! SQLite_INCDIR = sqlite
! }
! isEmpty( SQLite_LIBDIR ) {
! message( "Warning: SQLite_LIBDIR was not defined!" )
! SQLite_LIBDIR = -Lsqlite
! }
! }
!
! # Python includes. Run configure script to initialize it.
! isEmpty( PY_INCDIR ) {
! message( "Warinng: PY_INCDIR was not defined!" )
! exists( /usr/local/include/python2.3/Python.h ) {
! message( "Python includes found in: /usr/local/include/python2.3" )
! PY_INCDIR = /usr/local/include/python2.3
! }
! else:exists( /usr/local/include/Python2.3/Python.h ) {
! message( "Python includes found in: /usr/local/include/Python2.3" )
! PY_INCDIR = /usr/local/include/Python2.3
! }
! else:exists( /usr/include/python2.3/Python.h ) {
! message( "Python includes found in: /usr/include/python2.3" )
! PY_INCDIR = /usr/include/python2.3
! }
! else:exists( /usr/include/Python2.3/Python.h ) {
! message( "Python includes found in: /usr/include/Python2.3" )
! PY_INCDIR = /usr/include/Python2.3
! }
!
! }
! isEmpty( PY_LIBDIR ) {
! message( "Warinng: PY_LIBDIR was not defined!" )
! shared {
! message( "Using Shared Python Configuration..." )
! exists( /usr/local/lib/python2.3/config/libpython2.3.a ) {
! message( "Found libpython2.3.a in /usr/local/lib/python2.3/config" )
! PY_LIBDIR = -L/usr/local/lib/python2.3/config -lpython2.3
! }
! else:exists( /usr/lib/python2.3/config/libpython2.3.a ) {
! message( "Found libpython2.3.a in /usr/lib/python2.3/config" )
! PY_LIBDIR = -L/usr/lib/python2.3/config -lpython2.3
! }
!
! }
! else {
! message( "Using Static Python Configuration..." )
! exists( /usr/local/lib/libpython2.3.so ) {
! message( "Found libpython2.3.so in /usr/local/lib" )
! PY_LIBDIR = -lpython2.3
! }
! exists( /usr/lib/libpython2.3.so ) {
! message( "Found libpython2.3.so in /usr/lib" )
! PY_LIBDIR = -lpython2.3
! }
!
! }
! }
!
! INCLUDEPATH += $$PY_INCDIR $$MySQL_INCDIR $$SQLite_INCDIR
! LIBS += $$PY_LIBDIR $$MySQL_LIBDIR $$SQLite_LIBDIR
!
! # We need to remove these to be safe
QMAKE_LIBS_X11 -= -lX11 -lXext -lm
}
! win32 {
! INCLUDEPATH += $$PY_INCDIR $$MySQL_INCDIR $$SQLite_INCDIR
! LIBS += $$PY_LIBDIR $$MySQL_LIBDIR $$SQLite_LIBDIR
! }
RC_FILE = res.rc
--- 17,25 ----
CONFIG += console
! # We need to remove these, unnecessary dependency
QMAKE_LIBS_X11 -= -lX11 -lXext -lm
}
! DEFINES += QT_CLEAN_NAMESPACE
RC_FILE = res.rc
***************
*** 128,135 ****
MOC_DIR = obj
! win32:INCLUDEPATH += sqlite
win32:DEFINES -= UNICODE
! # Include configure's settings
!include(config.pri) {
message("HINT: use ./configure script!")
--- 27,34 ----
MOC_DIR = obj
! INCLUDEPATH += sqlite
win32:DEFINES -= UNICODE
! # Include configure settings
!include(config.pri) {
message("HINT: use ./configure script!")
***************
*** 378,384 ****
LICENSE.GPL
- unix {
- INCPATH -= /usr/include/python2.2
- }
-
- message( "Please make sure you execute: python configure.py" )
--- 277,278 ----
Index: configure
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/configure,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** configure 5 Aug 2004 22:19:39 -0000 1.36
--- configure 19 Aug 2004 05:29:06 -0000 1.37
***************
*** 9,12 ****
echo ""
- echo "Now please execute 'make' to compile Wolfpack."
--- 9,11 ----
Index: configure.py
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/configure.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** configure.py 14 Aug 2004 05:42:48 -0000 1.19
--- configure.py 19 Aug 2004 05:29:06 -0000 1.20
***************
*** 24,28 ****
mysql_incpath = ""
! sys.stdout.write( "Wolfpack configure script\n" )
def findFile( searchpath ):
--- 24,62 ----
mysql_incpath = ""
! # Color codes ( borrowed from Gentoo's portage code )
! colorcodes = {}
! colorcodes["reset"] = "\x1b[0m"
! colorcodes["bold"] = "\x1b[01m"
! colorcodes["green"] = "\x1b[32;01m"
! colorcodes["red"] = "\x1b[31;01m"
! colorcodes["darkred"] = "\x1b[31;06m"
!
! def nocolor():
! for x in colorcodes.keys():
! colorcodes[x] = ""
! def bold( text ):
! return colorcodes["bold"] + text + colorcodes["reset"]
! def red( text ):
! return colorcodes["red"] + text + colorcodes["reset"]
! def darkred( text ):
! return colorcodes["darkred"] + text + colorcodes["reset"]
! def green( text ):
! return colorcodes["green"] + text + colorcodes["reset"]
!
!
! def buildLibLine( path, file ):
!
! if path == "" or file == "":
! return ""
!
! if sys.platform == "win32":
! return path + os.path.pathsep + file
! else:
! if file[0:3] == "lib":
! file = file[3:]
! if file[-3:] == ".so":
! file = file[0:-3]
! result = "-L%s -l%s" % ( path, file )
! return result
def findFile( searchpath ):
***************
*** 50,54 ****
sys.stdout.write( "ok\n" )
else:
! sys.stdout.write( "failed\n" )
sys.stdout.write( "You must properly setup QTDIR" )
sys.exit();
--- 84,88 ----
sys.stdout.write( "ok\n" )
else:
! sys.stdout.write( red("failed") + "\n" )
sys.stdout.write( "You must properly setup QTDIR" )
sys.exit();
***************
*** 163,167 ****
else:
! sys.stdout.write("ERROR: Unknown platform %s to checkPython()" % sys.platform )
sys.exit()
--- 197,201 ----
else:
! sys.stdout.write(red("ERROR")+": Unknown platform %s to checkPython()" % sys.platform )
sys.exit()
***************
*** 180,196 ****
sys.stdout.write("ok\n")
else:
! sys.stdout.write( "failed\n" )
! sys.stdout.write( "Wolfpack requires Python version greater than 2.3.0 " )
sys.exit();
- sys.stdout.write( "Checking unicode support... " )
- if sys.maxunicode > 65535:
- sys.stdout.write( "failed\n" )
- sys.stdout.write( "Wolfpack currently requires python to be compiled with UCS2, its compiled with UCS4\n" )
- sys.exit();
- else:
- sys.stdout.write( "ok\n" )
! sys.stdout.write( "Checking CPU byte order... %s" % sys.byteorder )
if sys.byteorder != 'little':
sys.stdout.write("\nError: Wolfpack currently only supports little endian systems\n" )
--- 214,223 ----
sys.stdout.write("ok\n")
else:
! sys.stdout.write( red("failed") + "\n" )
! sys.stdout.write( bold("Wolfpack requires Python version greater than 2.3.0 ") )
sys.exit();
! sys.stdout.write( "Checking CPU byte order... %s\n" % sys.byteorder )
if sys.byteorder != 'little':
sys.stdout.write("\nError: Wolfpack currently only supports little endian systems\n" )
***************
*** 206,210 ****
sys.stdout.write("%s\n" % os.path.join( py_libpath, py_libfile ) )
else:
! sys.stdout.write("Not Found!\n")
sys.exit()
--- 233,237 ----
sys.stdout.write("%s\n" % os.path.join( py_libpath, py_libfile ) )
else:
! sys.stdout.write(red("Not Found!") + "\n")
sys.exit()
***************
*** 216,220 ****
sys.stdout.write( "%s\n" % py_incpath )
else:
! sys.stdout.write("Not Found!\n")
sys.exit()
--- 243,247 ----
sys.stdout.write( "%s\n" % py_incpath )
else:
! sys.stdout.write(red("Not Found!") + "\n")
sys.exit()
***************
*** 230,233 ****
--- 257,261 ----
parser = OptionParser(version="%prog 0.1")
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")
***************
*** 239,242 ****
--- 267,273 ----
(options, args) = parser.parse_args()
+ if options.nocolor:
+ nocolor()
+
checkPython(options)
if options.enable_mysql:
***************
*** 256,268 ****
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
! PY_LIBDIR = ""
! if sys.platform == "win32":
! PY_LIBDIR = os.path.join( py_libpath, py_libfile )
! else:
! PY_LIBDIR = "-L%s -lpython2.3" % ( py_libpath )
config.write("PY_INCDIR = %s\n" % ( py_incpath ) )
config.write("PY_LIBDIR = %s\n" % PY_LIBDIR)
--- 287,295 ----
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
! PY_LIBDIR = buildLibLine( py_libpath, py_libfile )
config.write("PY_INCDIR = %s\n" % ( py_incpath ) )
config.write("PY_LIBDIR = %s\n" % PY_LIBDIR)
***************
*** 270,286 ****
# Build MySQL Libs and Includes
! MySQL_LIBDIR = ""
! if sys.platform == "win32":
! MySQL_LIBDIR = os.path.join( mysql_libpath, mysql_libfile )
! else:
! MySQL_LIBDIR = "-L%s -lmysqlclient" % ( mysql_libpath )
config.write("MySQL_INCDIR = %s\n" % mysql_incpath )
config.write("MySQL_LIBDIR = %s\n" % MySQL_LIBDIR )
- # Build SQLite Libs and Includes
- CONFIG += "sqlite "
- config.write("SQLite_INCDIR = sqlite\n" )
- config.write("SQLite_LIBDIR = -lsqlite\n" )
-
# if --debug
if options.enable_debug:
--- 297,304 ----
# Build MySQL Libs and Includes
! MySQL_LIBDIR = buildLibLine( mysql_libpath, mysql_libfile )
config.write("MySQL_INCDIR = %s\n" % mysql_incpath )
config.write("MySQL_LIBDIR = %s\n" % MySQL_LIBDIR )
# if --debug
if options.enable_debug:
***************
*** 293,305 ****
config.write("DEFINES += %s\n" % DEFINES)
config.write("CONFIG += %s\n" % CONFIG)
config.close()
! sys.stdout.write("Generating makefile...\n")
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("Done\n")
! sys.stdout.write("Configure finished. Please run make now.\n")
if __name__ == "__main__":
--- 311,325 ----
config.write("DEFINES += %s\n" % DEFINES)
config.write("CONFIG += %s\n" % CONFIG)
+ config.write("LIBS += $$PY_LIBDIR $$MySQL_LIBDIR \n")
+ config.write("INCLUDEPATH += $$PY_INCDIR $$MySQL_INCDIR \n")
config.close()
! sys.stdout.write(green("Generating makefile..."))
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"))
if __name__ == "__main__":
|