Commit a746a09b a746a09b008fa5fb297a50422913e1918341ad11 by Sergey Poznyakoff

Do not allow to specify modules more than once

1 parent 54200808
...@@ -453,6 +453,13 @@ AC_DEFUN([MU_SQL_LDADD],[ ...@@ -453,6 +453,13 @@ AC_DEFUN([MU_SQL_LDADD],[
453 fi 453 fi
454 ]) 454 ])
455 455
456 add_sql_module() {
457 case $SQL_MODULES in
458 *$1*) AC_MSG_FAILURE([$1 specified twice]);;
459 *) SQL_MODULES="$SQL_MODULES $1";;
460 esac
461 }
462
456 ## ********* 463 ## *********
457 ## MySQL 464 ## MySQL
458 ## ********* 465 ## *********
...@@ -473,7 +480,7 @@ AC_ARG_WITH(mysql, ...@@ -473,7 +480,7 @@ AC_ARG_WITH(mysql,
473 AC_HELP_STRING([--with-mysql], 480 AC_HELP_STRING([--with-mysql],
474 [Configure to work with MySQL]), 481 [Configure to work with MySQL]),
475 [case $withval in 482 [case $withval in
476 yes) SQL_MODULES="$SQL_MODULES mysql" 483 yes) add_sql_module "mysql"
477 ;; 484 ;;
478 no) ;; 485 no) ;;
479 esac]) 486 esac])
...@@ -496,7 +503,7 @@ AC_ARG_WITH(postgres, ...@@ -496,7 +503,7 @@ AC_ARG_WITH(postgres,
496 AC_HELP_STRING([--with-postgres], 503 AC_HELP_STRING([--with-postgres],
497 [Configure to work with Postgres]), 504 [Configure to work with Postgres]),
498 [case $withval in 505 [case $withval in
499 yes) SQL_MODULES="$SQL_MODULES postgres" 506 yes) add_sql_module "postgres"
500 ;; 507 ;;
501 no) ;; 508 no) ;;
502 esac]) 509 esac])
...@@ -508,7 +515,7 @@ AC_ARG_WITH(sql, ...@@ -508,7 +515,7 @@ AC_ARG_WITH(sql,
508 [for mod in `echo $withval | tr ':,' ' '` 515 [for mod in `echo $withval | tr ':,' ' '`
509 do 516 do
510 if test -r $srcdir/sql/${mod}.c; then 517 if test -r $srcdir/sql/${mod}.c; then
511 SQL_MODULES="$SQL_MODULES ${mod}" 518 add_sql_module "${mod}"
512 else 519 else
513 AC_MSG_ERROR(No such SQL module: $mod) 520 AC_MSG_ERROR(No such SQL module: $mod)
514 fi 521 fi
......