[117] | 1 | @echo off |
---|
| 2 | |
---|
| 3 | rem |
---|
| 4 | rem "Main" |
---|
| 5 | rem |
---|
| 6 | |
---|
| 7 | if not "%1"=="" ( |
---|
| 8 | if not "%1"=="-library" ( |
---|
| 9 | call :PrintUsage |
---|
| 10 | goto EOF |
---|
| 11 | ) |
---|
| 12 | ) |
---|
| 13 | |
---|
| 14 | rem only ask to accept the license text once |
---|
| 15 | if exist .licenseAccepted goto HandleArgs |
---|
| 16 | |
---|
| 17 | rem determine if free or commercial package |
---|
| 18 | set edition=commercial |
---|
| 19 | if exist LICENSE.LGPL. set edition=free |
---|
| 20 | |
---|
| 21 | if %edition%==free ( |
---|
| 22 | call :HandleFree |
---|
| 23 | ) else ( |
---|
| 24 | call :RegionLoop |
---|
| 25 | call :Comm |
---|
| 26 | ) |
---|
| 27 | echo . |
---|
| 28 | |
---|
| 29 | if not exist .licenseAccepted ( |
---|
| 30 | echo You are not licensed to use this software. |
---|
| 31 | goto EOF |
---|
| 32 | ) |
---|
| 33 | |
---|
| 34 | :HandleArgs |
---|
| 35 | if exist config.pri. del config.pri |
---|
| 36 | if "%1"=="-library" ( |
---|
| 37 | echo Configuring to build this component as a dynamic library. |
---|
| 38 | echo SOLUTIONS_LIBRARY = yes > config.pri |
---|
| 39 | ) |
---|
| 40 | |
---|
| 41 | echo . |
---|
| 42 | echo This component is now configured. |
---|
| 43 | echo . |
---|
| 44 | echo To build the component library (if requested) and example(s), |
---|
| 45 | echo run qmake and your make or nmake command. |
---|
| 46 | echo . |
---|
| 47 | echo To remove or reconfigure, run make (nmake) distclean. |
---|
| 48 | echo . |
---|
| 49 | |
---|
| 50 | goto EOF |
---|
| 51 | |
---|
| 52 | rem |
---|
| 53 | rem "License acceptance loops" |
---|
| 54 | rem |
---|
| 55 | |
---|
| 56 | :RegionLoop |
---|
| 57 | echo . |
---|
| 58 | echo Please choose your region. |
---|
| 59 | echo . |
---|
| 60 | echo Type 1 for North or South America. |
---|
| 61 | echo Type 2 for anywhere outside North and South America. |
---|
| 62 | echo . |
---|
| 63 | set /p region=Select: |
---|
| 64 | if %region%==1 ( |
---|
| 65 | set licenseFile=LICENSE.US |
---|
| 66 | goto EOF |
---|
| 67 | ) |
---|
| 68 | if %region%==2 ( |
---|
| 69 | set licenseFile=LICENSE.NO |
---|
| 70 | goto EOF |
---|
| 71 | ) |
---|
| 72 | goto RegionLoop |
---|
| 73 | |
---|
| 74 | :HandleFree |
---|
| 75 | echo . |
---|
| 76 | echo You are licensed to use this software under the terms of |
---|
| 77 | echo the GNU General Public License (GPL) version 3, or |
---|
| 78 | echo the GNU Lesser General Public License (LGPL) version 2.1 |
---|
| 79 | echo with certain additional extra rights as specified in the |
---|
| 80 | echo Nokia Qt LGPL Exception version 1.1. |
---|
| 81 | echo . |
---|
| 82 | echo Type 'G' to view the GNU General Public License (GPL) version 3 |
---|
| 83 | echo Type 'L' to view the GNU Lesser General Public License (LGPL) version 2.1 |
---|
| 84 | echo Type 'E' to view the Nokia Qt LGPL Exception version 1.1. |
---|
| 85 | echo Type 'yes' to accept this license offer. |
---|
| 86 | echo Type 'no' to decline this license offer. |
---|
| 87 | echo . |
---|
| 88 | set /p answer=Do you accept the terms of this license? |
---|
| 89 | |
---|
| 90 | if %answer%==no goto EOF |
---|
| 91 | if %answer%==yes ( |
---|
| 92 | echo license accepted > .licenseAccepted |
---|
| 93 | goto EOF |
---|
| 94 | ) |
---|
| 95 | if %answer%==g more LICENSE.GPL3 |
---|
| 96 | if %answer%==G more LICENSE.GPL3 |
---|
| 97 | if %answer%==l more LICENSE.LGPL |
---|
| 98 | if %answer%==L more LICENSE.LGPL |
---|
| 99 | if %answer%==e more LGPL_EXCEPTION.txt |
---|
| 100 | if %answer%==E more LGPL_EXCEPTION.txt |
---|
| 101 | goto HandleFree |
---|
| 102 | |
---|
| 103 | :Comm |
---|
| 104 | echo . |
---|
| 105 | echo License Agreement |
---|
| 106 | echo . |
---|
| 107 | echo Type '?' to view the Qt Solutions Commercial License. |
---|
| 108 | echo Type 'yes' to accept this license offer. |
---|
| 109 | echo Type 'no' to decline this license offer. |
---|
| 110 | echo . |
---|
| 111 | set /p answer=Do you accept the terms of this license? |
---|
| 112 | |
---|
| 113 | if %answer%==no goto EOF |
---|
| 114 | if %answer%==yes ( |
---|
| 115 | echo license accepted > .licenseAccepted |
---|
| 116 | copy %licenseFile% LICENSE |
---|
| 117 | del LICENSE.US |
---|
| 118 | del LICENSE.NO |
---|
| 119 | goto EOF |
---|
| 120 | ) |
---|
| 121 | if %answer%==? more %licenseFile% |
---|
| 122 | goto Comm |
---|
| 123 | |
---|
| 124 | :PrintUsage |
---|
| 125 | echo Usage: configure.bat [-library] |
---|
| 126 | echo . |
---|
| 127 | echo -library: Build the component as a dynamic library (DLL). Default is to |
---|
| 128 | echo include the component source directly in the application. |
---|
| 129 | echo A DLL may be preferable for technical or licensing (LGPL) reasons. |
---|
| 130 | echo . |
---|
| 131 | goto EOF |
---|
| 132 | |
---|
| 133 | |
---|
| 134 | :EOF |
---|