+@ECHO off\r
+SET QMAKE=qmake\r
+SET MAKE=nmake\r
+SET PROJECT_ROOT=%CD%\r
+SET TESTDIR=%PROJECT_ROOT%\config.tests\r
+SET CONFIG_LOG=config.log\r
+SET LAST_FUNC_RET=0\r
+\r
+if exist %PROJECT_ROOT%\config.in del %PROJECT_ROOT%\config.in\r
+if exist %PROJECT_ROOT%\config.log del %PROJECT_ROOT%\config.log\r
+if exist %PROJECT_ROOT%\depends.pri del %PROJECT_ROOT%\depends.pri\r
+\r
+echo #depends.pri > %PROJECT_ROOT%\depends.pri\r
+ \r
+shift\r
+set QMAKEBIN=qmake\r
+set MSVCMODE=\r
+set OPENSSL=1\r
+set FCGI=1\r
+echo include(depends.pri) > %PROJECT_ROOT%\config.in\r
+echo QXT_stability += unknown >> %PROJECT_ROOT%\config.in\r
+\r
+:top\r
+if "%0" == "" goto finish\r
+if "%0" == "-qmake-bin" goto setqmake\r
+if "%0" == "-I" goto addinclude \r
+if "%0" == "-L" goto addlibpath\r
+if "%0" == "-l" goto addlib\r
+if "%0" == "-nomake" goto nomake\r
+if "%0" == "-prefix" goto prefix\r
+if "%0" == "-libdir" goto libdir \r
+if "%0" == "-docdir" goto docdir\r
+if "%0" == "-headerdir" goto headerdir\r
+if "%0" == "-bindir" goto bindir\r
+if "%0" == "-static" goto static\r
+if "%0" == "-debug" goto debug\r
+if "%0" == "-release" goto release\r
+if "%0" == "-no-openssl" goto noopenssl\r
+if "%0" == "-msvc" goto msvc\r
+if "%0" == "/help" goto help\r
+if "%0" == "-help" goto help\r
+if "%0" == "--help" goto help\r
+if "%0" == "/?" goto help\r
+\r
+echo Unrecognized configure option: %0\r
+del %PROJECT_ROOT%\config.in\r
+goto end\r
+\r
+:setqmake\r
+set QMAKEBIN=%1\r
+goto bottom2\r
+\r
+:addinclude\r
+echo INCLUDEPATH += "%1" >> %PROJECT_ROOT%\depends.pri\r
+goto bottom2 \r
+\r
+:addlibpath\r
+echo LIBS += -L"%1" >> %PROJECT_ROOT%\depends.pri\r
+goto bottom2\r
+\r
+:addlib\r
+echo LIBS += -l"%1" >> %PROJECT_ROOT%\depends.pri\r
+goto bottom2\r
+\r
+:nomake\r
+if "%1"=="fcgi" set FCGI=0\r
+echo QXT_BUILD -= %1 >> %PROJECT_ROOT%\config.in\r
+goto bottom2\r
+\r
+:prefix\r
+echo QXTINSTALLDIR = %1 >> %PROJECT_ROOT%\config.in\r
+goto bottom2\r
+\r
+:libdir\r
+echo target.path = %1 >> %PROJECT_ROOT%\config.in\r
+goto bottom2\r
+\r
+:docdir\r
+echo docs.path = %1 >> %PROJECT_ROOT%\config.in\r
+goto bottom2\r
+\r
+:headerdir\r
+echo include.path = %1 >> %PROJECT_ROOT%\config.in\r
+goto bottom2\r
+\r
+:bindir\r
+echo bin.path = %1 >> %PROJECT_ROOT%\config.in\r
+goto bottom2\r
+\r
+:static\r
+echo CONFIG += static staticlib >> %PROJECT_ROOT%\config.in\r
+goto bottom \r
+\r
+:debug\r
+echo CONFIG += debug >> %PROJECT_ROOT%\config.in\r
+goto bottom\r
+\r
+:release\r
+echo CONFIG += release >> %PROJECT_ROOT%\config.in\r
+goto bottom\r
+\r
+:noopenssl\r
+set OPENSSL=0\r
+echo QXT_LIBS -= openssl >> %PROJECT_ROOT%\config.in\r
+goto bottom\r
+\r
+:msvc\r
+set MSVCMODE=-tp vc\r
+goto bottom\r
+\r
+:bottom2\r
+ shift\r
+:bottom\r
+ shift\r
+goto top\r
+ \r
+:help\r
+ echo Usage: configure [-prefix (dir)] [-libdir (dir)] [-docdir (dir)]\r
+ echo [-bindir (dir)] [-headerdir (dir)] [-qmake-bin (path)]\r
+ echo [-static] [-debug] [-release] [-no-stability-unknown]\r
+ echo [-no-openssl] [-nomake (module)] [-msvc]\r
+ echo.\r
+ echo Installation options:\r
+ echo.\r
+ echo -prefix (dir) ....... This will install everything relative to (dir)\r
+ echo default: C:\libqxt\r
+ echo -libdir (dir) ....... Libraries will be installed to (dir)\r
+ echo default: PREFIX/lib\r
+ echo -docdir (dir) ....... Documentation will be installed to (dir)\r
+ echo default: PREFIX/share/doc\r
+ echo -bindir (dir) ....... Executables will be installed to (dir)\r
+ echo default: PREFIX/bin\r
+ echo -headerdir (dir) .... Include files will be installed to (dir)\r
+ echo default: PREFIX/include\r
+ echo -qmake-bin (path) ... Specifies the path to the qmake executable\r
+ echo default: search the system path\r
+ echo -L (path)............ Specifies the a additional library search path\r
+ echo -I (path)............ Specifies the a additional include search path\r
+ echo -l (path)............ Add a custom library\r
+ echo -static ............. Compile Qxt as a static library\r
+ echo -debug .............. Build Qxt with debugging symbols\r
+ echo -release ............ Build Qxt without debugging support\r
+ echo -no-openssl ......... Do not link to OpenSSL\r
+ echo -nomake (module) .... Do not compile the specified module\r
+ echo options: network gui sql media web designer\r
+ echo -msvc ............... Configure Qxt to use Microsoft Visual Studio\r
+\r
+ del %PROJECT_ROOT%\config.in\r
+ goto end\r
+\r
+:finish\r
+echo Testing for qmake...\r
+qmake -v >> %PROJECT_ROOT%\%CONFIG_LOG%\r
+if errorlevel 1 goto qmakeERR\r
+goto qmakeOK\r
+:qmakeERR\r
+echo You don't seem to have 'qmake' in your PATH.\r
+echo Cannot proceed.\r
+goto end\r
+\r
+:qmakeOK\r
+if "%QMAKESPEC%" == "win32-msvc" goto testnmake\r
+if "%QMAKESPEC%" == "win32-msvc.net" goto testnmake\r
+if "%QMAKESPEC%" == "win32-msvc2005" goto testnmake\r
+\r
+:testmingw\r
+echo Testing for mingw32-make...\r
+call mingw32-make -v >> %PROJECT_ROOT%\%CONFIG_LOG%\r
+if errorlevel 1 goto testnmake\r
+echo Using mingw32-make. \r
+SET MAKE=mingw32-make\r
+GOTO detectTools_end_test_make \r
+\r
+:testnmake\r
+if "%QMAKESPEC%" == "win32-g++" goto testgmake\r
+echo Testing for nmake...\r
+call nmake /? >> %PROJECT_ROOT%\%CONFIG_LOG%\r
+if errorlevel 1 goto testgmake\r
+echo Using nmake.\r
+SET MAKE=nmake\r
+GOTO detectTools_end_test_make\r
+\r
+:testgmake\r
+echo Testing for GNU make...\r
+call make -v >> %PROJECT_ROOT%\%CONFIG_LOG%\r
+if errorlevel 1 goto missingmake\r
+echo Using GNU make.\r
+SET MAKE=make\r
+GOTO detectTools_end_test_make\r
+ \r
+:missingmake\r
+echo You don't seem to have 'mingw32-make', 'nmake' or 'make' in your PATH. \r
+echo Cannot proceed.\r
+goto end\r
+\r
+:detectTools_end_test_make\r
+if "%OPENSSL%"=="0" goto detectfcgi\r
+echo Testing for OpenSSL... \r
+echo OpenSSL... >> %PROJECT_ROOT%\%CONFIG_LOG%\r
+cd %TESTDIR%\openssl\r
+%QMAKE% >> %PROJECT_ROOT%\%CONFIG_LOG%\r
+if errorlevel 1 goto opensslfailed\r
+call %MAKE% clean >> %PROJECT_ROOT%\%CONFIG_LOG%\r
+call %MAKE% >> %PROJECT_ROOT%\%CONFIG_LOG%\r
+if errorlevel 1 goto opensslfailed\r
+set OPENSSL=1\r
+goto detectfcgi\r
+\r
+:opensslfailed\r
+set OPENSSL=0\r
+echo QXT_LIBS -= openssl >> %PROJECT_ROOT%\config.in\r
+\r
+:detectfcgi\r
+if "%FCGI%"=="0" goto skipfcgitest\r
+echo Testing for FastCGI...\r
+echo fcgi... >> %PROJECT_ROOT%\%CONFIG_LOG%\r
+cd %TESTDIR%\fcgi\r
+%QMAKE% >> %PROJECT_ROOT%\%CONFIG_LOG%\r
+if errorlevel 1 goto fcgifailed\r
+call %MAKE% clean >> %PROJECT_ROOT%\%CONFIG_LOG%\r
+call %MAKE% >> %PROJECT_ROOT%\%CONFIG_LOG%\r
+if errorlevel 1 goto fcgifailed\r
+set FCGI=1\r
+goto alltestsok\r
+\r
+:fcgifailed\r
+set FCGI=0\r
+echo QXT_BUILD -= fcgi >> %PROJECT_ROOT%\config.in\r
+\r
+:skipfcgitest\r
+:alltestsok\r
+cd %PROJECT_ROOT%\r
+\r
+echo Configuration successful.\r
+if "%OPENSSL%"=="1" echo OpenSSL enabled.\r
+if "%OPENSSL%"=="0" echo OpenSSL disabled.\r
+if "%FCGI%"=="1" echo FastCGI enabled.\r
+if "%FCGI%"=="0" echo FastCGI disabled.\r
+echo Generating makefiles...\r
+copy %PROJECT_ROOT%\config.pri %PROJECT_ROOT%\config.pri.bak >> %PROJECT_ROOT%\%CONFIG_LOG%\r
+copy %PROJECT_ROOT%\config.in %PROJECT_ROOT%\config.pri >> %PROJECT_ROOT%\%CONFIG_LOG%\r
+del %PROJECT_ROOT%\config.in >> %PROJECT_ROOT%\%CONFIG_LOG%\r
+%QMAKE% %MSVCMODE% -recursive\r
+if errorlevel 1 goto mainqmakeERR\r
+\r
+echo Makefiles generated. Run %MAKE% now.\r
+goto end\r
+\r
+:mainqmakeERR\r
+echo Error running qmake. Cannot proceed.\r
+goto end\r
+\r
+:end \r