Merge qt_menu qt_window_menu

This commit is contained in:
Laurent Rineau 2003-06-12 12:03:59 +00:00
parent cebcbf44db
commit 6d779a4fb6
2 changed files with 92 additions and 277 deletions

View File

@ -6,6 +6,9 @@
//---------------------------------------------------------------------
// actual revision
//---------------------------------------------------------------------
GLOB: In install_cgal:
GLOB: Change the Qt support menu, by merging the qt_window_menu and
GLOBL qt_menu functions
GLOB: Remove CC specification from GMP's configure, and update the doc.
GLOB: fix a bashism in install_cgal
GLOB: QT_MOC is now always added in the master makefile, as it should be.

View File

@ -1683,6 +1683,15 @@ qt_libpathflags()
fi
}
lib_qt()
{
if [ "${QT_T_SUPPORT}" = 'n' ]; then
lib_option "qt"
else
lib_option "qt-mt"
fi
}
qt_ldflags()
{
if [ -n "${QT_SUPPORT}" ]; then
@ -1698,7 +1707,7 @@ qt_ldflags()
fi
fi
if [ -z "${WINDOWS_COMPILER}" ]; then
lib_option "qt"
lib_qt
else
lib_option "qtmain"
lib_option "${QT_SECOND_LIB}"
@ -3444,7 +3453,7 @@ test_for_qt_lib_in_sys_lib()
if _compile_test "Qt syslibs" "${CUSTOM_CXXFLAGS} " "$1";
then
if _link_run_test "Qt syslibs" "" \
"${CUSTOM_LDFLAGS} `lib_option qt`" "$1"; then
"${CUSTOM_LDFLAGS} `lib_qt`" "$1"; then
NEED_EXTRA_QT_LDIR=''
return 0
fi
@ -4353,7 +4362,7 @@ compiler_choose_menu()
while [ $i -lt ${_COMPILER_NUMBER} ]; do
_tmp=`eval "echo '$'_COMPILER_$i"`
_tmp=`eval "echo ${_tmp}"`
if [ "${COMPILER_NAME}" = `compiler_bin ${_tmp}` ]; then
if [ "${COMPILER_NAME}" == `compiler_bin ${_tmp}` ]; then
return
fi
eval "${_EXPR} ${i} + 1"
@ -4646,258 +4655,6 @@ gmp_menu()
# qt_menu to setup Qt
#
qt_windows_menu()
{
while [ 0 ]; do
menu_header 'Qt'
print_line "${_bold_on}<K>${_bold_off} Toggle Qt support"
if [ -n "${QT_SUPPORT}" ]; then
if [ -z "${QT_ADVANCED_MODE}" ]; then
print_line "${_bold_on}<A>${_bold_off} Advanced mode"
print_line \
"${_bold_on}<D>${_bold_off} Qt directory"
if [ -n "${NEED_EXTRA_QTDIR}" ]; then
if [ -z "${QT_DIR}" ]; then
_tmp1='<undefined>'
else
_tmp1="`posix_path ${QT_DIR}`"
fi
print_line " ${_tmp1}"
if [ "${NEED_EXTRA_QTDIR}" = "x" ]; then
print_line "${_bold_on}<E>${_bold_off} Use \$QTDIR as Qt directory."
fi
else
_tmp1="`posix_path ${QT_DIR}`"
print_line " ${_tmp1} <defined in \$QTDIR>"
fi
else
print_line "${_bold_on}<B>${_bold_off} Basic mode"
print_line "${_bold_on}<I>${_bold_off} Qt include directory"
if [ -n "${NEED_EXTRA_QT_IDIR}" ]; then
print_line " `posix_path ${QT_INCL_DIR:-<undefined>}`"
if [ "${NEED_EXTRA_QT_IDIR}" = "x" ]; then
print_line "${_bold_on}<J>${_bold_off} Use Qt headers from system include."
fi
else
print_line " <system include directory>"
fi
print_line "${_bold_on}<L>${_bold_off} Qt lib directory"
if [ -n "${NEED_EXTRA_QT_LDIR}" ]; then
print_line " `posix_path ${QT_LIB_DIR:-<undefined>}`"
if [ "${NEED_EXTRA_QT_LDIR}" = "x" ]; then
print_line "${_bold_on}<M>${_bold_off} Use Qt libs from system libdir."
fi
else
print_line " <system lib directory>"
fi
print_line "${_bold_on}<O>${_bold_off} Qt moc executable"
if [ -n "${NEED_EXTRA_QTMOC}" ]; then
print_line " `posix_path ${QT_MOC:-<undefined>}`"
if [ "${NEED_EXTRA_QTMOC}" = "x" ]; then
print_line "${_bold_on}<P>${_bold_off} Use Qt moc from path."
fi
else
print_line " <in path>"
fi
fi
print_line "${_bold_on}<R>${_bold_off} Set the second lib used along with qtmain.lib"
if [ "${QT_SECOND_LIB}" = 'qt' ]; then
print_line " The default one is qt.lib"
else
print_line " Qt second lib is ${QT_SECOND_LIB}.lib"
fi
print_line "${_bold_on}<S>${_bold_off} Toggle THREAD_SUPPORT"
if [ "${QT_T_SUPPORT}" = 'y' ]; then
print_line " Thread support is currently ON"
else
print_line " Thread support is currently OFF"
fi
print_line "${_bold_on}<F>${_bold_off} Toggle QT_DLL macro (used when Qt is built shared)"
if [ "${QT_DLL}" = 'not_defined' ]; then
print_line " QT_DLL macro is not defined"
else
print_line " QT_DLL macro is defined"
fi
fi
print_line "${_bold_on}<T>${_bold_off} Test (and save) setup"
menu_tailer 'Main Menu'
case ${KEY} in
k|K)
if [ -z "${QT_SUPPORT}" ]; then
SETUP_COMPLETE=''
QT_SUPPORT='_QT'
go_down_lines 3
flush_buffer
# test QTDIR if this was not done before
if [ "${NEED_EXTRA_QTDIR}" = 'n' ]; then
test_for_qt_dir "${INSTALL_VERBOSE}"
fi
if [ -z "${NEED_EXTRA_QT_DIR}"]; then
# test for QT sysincl/-lib and moc, if this was not
# done before
if [ "${NEED_EXTRA_QT_IDIR}" = 'n' -o \
"${NEED_EXTRA_QT_LDIR}" = 'n' -o \
"${NEED_EXTRA_QTMOC}" = 'n' ]; then
test_for_qt_moc_in_path "${INSTALL_VERBOSE}"
NEED_EXTRA_QTMOC='yes'
fi
fi
else
QT_SUPPORT=''
QT_ADVANCED_MODE=''
fi
;;
r|R)
change_value QT_SECOND_LIB;;
s|S)
if [ "${QT_T_SUPPORT}" = 'y' ]; then
QT_T_SUPPORT='n'
if [ "${QT_DLL}" = 'not_defined' ]; then
CGAL_QT_CXXFLAGS=''
else
CGAL_QT_CXXFLAGS='-DQT_DLL'
fi
else
QT_T_SUPPORT='y'
if [ "${QT_DLL}" = 'not_defined' ]; then
CGAL_QT_CXXFLAGS='-DQT_THREAD_SUPPORT'
else
CGAL_QT_CXXFLAGS='-DQT_DLL -DQT_THREAD_SUPPORT'
fi
fi
;;
f|F)
if [ "${QT_DLL}" = 'not_defined' ]; then
QT_DLL='y'
else
QT_DLL='not_defined'
fi
;;
a|A)
if [ -n "${QT_SUPPORT}" -a -z "${QT_ADVANCED_MODE}" ]; then
QT_ADVANCED_MODE='y'
QT_TEST_PASSED=''
QT_MOC_TEST_PASSED=''
SETUP_COMPLETE=''
fi
;;
b|B)
if [ -n "${QT_SUPPORT}" -a -n "${QT_ADVANCED_MODE}" ]; then
QT_ADVANCED_MODE=''
QT_TEST_PASSED=''
QT_MOC_TEST_PASSED=''
SETUP_COMPLETE=''
# test QTDIR if this was not done before
if [ "${NEED_EXTRA_QTDIR}" = 'n' ]; then
go_down_lines 3
flush_buffer
test_for_qt_dir "${INSTALL_VERBOSE}"
fi
if [ -n "${QT_DIR}" ]; then
qt_dir_has_changed
fi
fi
;;
d|D)
if [ -n "${QT_SUPPORT}" -a -z "${QT_ADVANCED_MODE}" ]; then
if [ -z "${NEED_EXTRA_QTDIR}" ]; then
NEED_EXTRA_QTDIR='x'
fi
if change_dir QT_DIR dir; then
if [ -z "${NEED_EXTRA_QTDIR}" ]; then
NEED_EXTRA_QTDIR='x'
fi
QT_TEST_PASSED=''
QT_MOC_TEST_PASSED=''
SETUP_COMPLETE=''
qt_dir_has_changed
fi
fi
;;
e|E)
if [ "${NEED_EXTRA_QTDIR}" = "x" ]; then
NEED_EXTRA_QTDIR=''
QT_TEST_PASSED=''
QT_MOC_TEST_PASSED=''
SETUP_COMPLETE=''
fi
;;
i|I)
if [ -n "${QT_SUPPORT}" ]; then
if [ -z "${NEED_EXTRA_QT_IDIR}" ]; then
NEED_EXTRA_QT_IDIR='x'
fi
if change_dir QT_INCL_DIR dir; then
if [ -z "${NEED_EXTRA_QT_IDIR}" ]; then
NEED_EXTRA_QT_IDIR='x'
fi
QT_TEST_PASSED=''
QT_MOC_TEST_PASSED=''
SETUP_COMPLETE=''
fi
fi
;;
j|J)
if [ "${NEED_EXTRA_QT_IDIR}" = "x" ]; then
NEED_EXTRA_QT_IDIR=''
QT_TEST_PASSED=''
QT_MOC_TEST_PASSED=''
SETUP_COMPLETE=''
fi
;;
l|L)
if [ -n "${QT_SUPPORT}" ]; then
if change_dir QT_LIB_DIR dir; then
if [ -z "${NEED_EXTRA_QT_LDIR}" ]; then
NEED_EXTRA_QT_LDIR='x'
fi
QT_TEST_PASSED=''
QT_MOC_TEST_PASSED=''
SETUP_COMPLETE=''
fi
fi
;;
m|M)
if [ "${NEED_EXTRA_QT_LDIR}" = "x" ]; then
NEED_EXTRA_QT_LDIR=''
QT_TEST_PASSED=''
QT_MOC_TEST_PASSED=''
SETUP_COMPLETE=''
fi
;;
o|O)
if [ -n "${QT_SUPPORT}" ]; then
if change_dir QT_MOC exe; then
if [ -z "${NEED_EXTRA_QTMOC}" ]; then
NEED_EXTRA_QTMOC='x'
fi
QT_TEST_PASSED=''
QT_MOC_TEST_PASSED=''
SETUP_COMPLETE=''
fi
fi
;;
p|P)
if [ "${NEED_EXTRA_QTMOC}" = "x" ]; then
NEED_EXTRA_QTMOC=''
QT_TEST_PASSED=''
QT_MOC_TEST_PASSED=''
SETUP_COMPLETE=''
fi
;;
t|T)
go_down_lines 3
flush_buffer
test_setup;;
q|Q|b|B)
return;;
*);;
esac done
}
qt_menu()
{
while [ 0 ]; do
@ -4928,7 +4685,8 @@ qt_menu()
print_line \
"${_bold_on}<I>${_bold_off} Qt include directory"
if [ -n "${NEED_EXTRA_QT_IDIR}" ]; then
print_line " ${QT_INCL_DIR:-<undefined>}"
print_line \
" `posix_path ${QT_INCL_DIR:-<undefined>}`"
if [ "${NEED_EXTRA_QT_IDIR}" = "x" ]; then
print_line \
"${_bold_on}<J>${_bold_off} Use Qt headers from system include."
@ -4938,7 +4696,8 @@ qt_menu()
fi
print_line "${_bold_on}<L>${_bold_off} Qt lib directory"
if [ -n "${NEED_EXTRA_QT_LDIR}" ]; then
print_line " ${QT_LIB_DIR:-<undefined>}"
print_line \
" `posix_path ${QT_LIB_DIR:-<undefined>}`"
if [ "${NEED_EXTRA_QT_LDIR}" = "x" ]; then
print_line \
"${_bold_on}<M>${_bold_off} Use Qt libs from system libdir."
@ -4948,7 +4707,7 @@ qt_menu()
fi
print_line "${_bold_on}<O>${_bold_off} Qt moc executable"
if [ -n "${NEED_EXTRA_QTMOC}" ]; then
print_line " ${QT_MOC:-<undefined>}"
print_line " `posix_path ${QT_MOC:-<undefined>}`"
if [ "${NEED_EXTRA_QTMOC}" = "x" ]; then
print_line \
"${_bold_on}<P>${_bold_off} Use Qt moc from path."
@ -4957,7 +4716,30 @@ qt_menu()
print_line " <in path>"
fi
fi
if [ -n "${WINDOWS_COMPILER}" ]; then
print_line \
"${_bold_on}<R>${_bold_off} Set the second lib used along with qtmain.lib"
if [ "${QT_SECOND_LIB}" = 'qt' ]; then
print_line " The default one is qt.lib"
else
print_line " Qt second lib is ${QT_SECOND_LIB}.lib"
fi
fi
print_line "${_bold_on}<S>${_bold_off} Toggle THREAD_SUPPORT"
if [ "${QT_T_SUPPORT}" = 'y' ]; then
print_line " Thread support is currently ON"
else
print_line " Thread support is currently OFF"
fi
if [ -n "${WINDOWS_COMPILER}" ]; then
print_line \
"${_bold_on}<F>${_bold_off} Toggle QT_DLL macro (used when Qt is built shared)"
if [ "${QT_DLL}" = 'not_defined' ]; then
print_line " QT_DLL macro is not defined"
else
print_line " QT_DLL macro is defined"
fi
fi
fi
print_line "${_bold_on}<T>${_bold_off} Test (and save) setup"
menu_tailer 'Main Menu'
@ -4968,31 +4750,65 @@ qt_menu()
QT_SUPPORT='_QT'
go_down_lines 3
flush_buffer
# test QTDIR if this was not done before
if [ "${NEED_EXTRA_QTDIR}" = 'n' ]; then
test_for_qt_dir "${INSTALL_VERBOSE}"
fi
# test for QT sysincl/-lib and moc, if this was not
# done before
if [ "${NEED_EXTRA_QT_IDIR}" = 'n' -o \
"${NEED_EXTRA_QT_LDIR}" = 'n' -o \
"${NEED_EXTRA_QTMOC}" = 'n' ]; then
test_for_qt_moc_in_path "${INSTALL_VERBOSE}"
test_for_qt_incl_in_sys_incl "${INSTALL_VERBOSE}"
test_for_qt_lib_in_sys_lib "${INSTALL_VERBOSE}"
if [ -z "${WINDOWS_COMPILER}" ]; then
test_for_qt_incl_in_sys_incl "${INSTALL_VERBOSE}"
test_for_qt_lib_in_sys_lib "${INSTALL_VERBOSE}"
fi
fi
if [ "${NEED_EXTRA_QT_IDIR}" = 'x' -a \
"${NEED_EXTRA_QT_LDIR}" = 'x' -a \
"${NEED_EXTRA_QTMOC}" = 'x' ]; then
QT_ADVANCED_MODE='y'
QT_ADVANCED_MODE='y'
else
QT_ADVANCED_MODE=''
# test QTDIR if this was not done before
if [ "${NEED_EXTRA_QTDIR}" = 'n' ]; then
test_for_qt_dir "${INSTALL_VERBOSE}"
fi
fi
else
QT_SUPPORT=''
QT_ADVANCED_MODE=''
fi
;;
r|R)
if [ -n "${WINDOWS_COMPILER}" ]; then
change_value QT_SECOND_LIB
fi;;
s|S)
if [ "${QT_T_SUPPORT}" = 'y' ]; then
QT_T_SUPPORT='n'
if [ "${QT_DLL}" = 'not_defined' ]; then
CGAL_QT_CXXFLAGS=''
else
CGAL_QT_CXXFLAGS='-DQT_DLL'
fi
else
QT_T_SUPPORT='y'
if [ "${QT_DLL}" = 'not_defined' ]; then
CGAL_QT_CXXFLAGS='-DQT_THREAD_SUPPORT'
else
CGAL_QT_CXXFLAGS='-DQT_DLL -DQT_THREAD_SUPPORT'
fi
fi
;;
f|F)
if [ -n "${WINDOWS_COMPILER}" ]; then
if [ "${QT_DLL}" = 'not_defined' ]; then
QT_DLL='y'
else
QT_DLL='not_defined'
fi
fi
;;
a|A)
if [ -n "${QT_SUPPORT}" -a -z "${QT_ADVANCED_MODE}" ]; then
QT_ADVANCED_MODE='y'
@ -5115,7 +4931,6 @@ qt_menu()
esac done
}
# ---------------------------------------------------------------------
# GNU GMP installation
#
@ -5706,7 +5521,7 @@ write_linker_flags()
SECOND_LIB=`lib_option "${QT_SECOND_LIB}"`
QLIBS="${LIBS} `lib_option CGALQt` `lib_option qtmain` `lib_option imm32` `lib_option wsock32` `lib_option gdi32` `lib_option user32` `lib_option ole32` `lib_option winspool` `lib_option comdlg32` `lib_option ws2_32` `lib_option shell32` `lib_option advapi32` ${SECOND_LIB}"
else
QLIBS="${LIBS} `lib_option qt` `lib_option CGALQt`"
QLIBS="${LIBS} `lib_qt` `lib_option CGALQt`"
fi
else
# QLIBS has to be set anyway
@ -6444,12 +6259,7 @@ main_menu()
g|G) gmp_menu;;
m|M) cln_menu;;
k|K)
if [ -z "${WINDOWS_COMPILER}" ]; then
qt_menu
else
qt_windows_menu
fi
;;
qt_menu;;
b|B)
if [ -z "${SETUP_COMPLETE}" ]; then
test_setup
@ -6476,10 +6286,12 @@ main_menu()
search_cln "${INSTALL_VERBOSE}"
fi
if [ -n "${QT_SUPPORT}" ]; then
test_for_qt_moc_in_path "${INSTALL_VERBOSE}"
test_for_qt_incl_in_sys_incl "${INSTALL_VERBOSE}"
test_for_qt_lib_in_sys_lib "${INSTALL_VERBOSE}"
test_for_qt_dir "${INSTALL_VERBOSE}"
test_for_qt_moc_in_path "${INSTALL_VERBOSE}"
if [ -z "${WINDOWS_COMPILER}" ]; then
test_for_qt_incl_in_sys_incl "${INSTALL_VERBOSE}"
test_for_qt_lib_in_sys_lib "${INSTALL_VERBOSE}"
fi
fi
test_setup;;
t|T)