Browse Source

Fix building without tcl.

git-svn-id: https://klish.googlecode.com/svn/trunk@288 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 13 years ago
parent
commit
211f934413
2 changed files with 52 additions and 47 deletions
  1. 26 23
      configure
  2. 26 24
      configure.ac

+ 26 - 23
configure

@@ -14931,7 +14931,7 @@ fi
 LUB_LIBS="-llub"
 LUB_CFLAGS=""
 
-if test x$LUB_LIBS = x; then
+if test "x$LUB_LIBS" = "x"; then
     as_fn_error "Cannot find the \"Little Useful Bits\" library" "$LINENO" 5
 fi
 
@@ -14943,7 +14943,7 @@ fi
 KONF_LIBS="-lkonf"
 KONF_CFLAGS=""
 
-if test x$KONF_LIBS = x; then
+if test "x$KONF_LIBS" = "x"; then
     as_fn_error "Cannot find the \"CLI config\" library" "$LINENO" 5
 fi
 
@@ -14955,7 +14955,7 @@ fi
 TINYRL_LIBS="-ltinyrl"
 TINYRL_CFLAGS=""
 
-if test x$TINYRL_LIBS = x; then
+if test "x$TINYRL_LIBS" = "x"; then
     as_fn_error "Cannot find the \"Tiny Readline\" library" "$LINENO" 5
 fi
 
@@ -14967,7 +14967,7 @@ fi
 TINYXML_LIBS="-ltinyxml"
 TINYXML_CXXFLAGS="-std=gnu++98"
 
-if test x$TINYXML_LIBS = x; then
+if test "x$TINYXML_LIBS" = "x"; then
     as_fn_error "Cannot find the \"Tiny XML\" library" "$LINENO" 5
 fi
 
@@ -15030,7 +15030,7 @@ if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then :
 
 $as_echo "#define HAVE_LIBPTHREAD /**/" >>confdefs.h
 
-                                if test x$with_pthread = x; then
+                                if test "x$with_pthread" = "x"; then
                                     PTHREAD_LIBS="-lpthread"
                                 else
                                     PTHREAD_CFLAGS="-I$with_pthread/include"
@@ -15047,7 +15047,7 @@ fi
 done
 
 
-if test x$PTHREAD_LIBS = x; then
+if test "x$PTHREAD_LIBS" = "x"; then
     as_fn_error "Cannot find the POSIX threads library" "$LINENO" 5
 fi
 
@@ -15102,7 +15102,7 @@ if test "x$ac_cv_lib_rt_clock_gettime" = x""yes; then :
 
 $as_echo "#define HAVE_LIBRT /**/" >>confdefs.h
 
-                if test x$with_rt = x; then
+                if test "x$with_rt" = "x"; then
                     RT_LIBS="-lrt"
                 else
                     RT_CFLAGS="-I$with_rt/include"
@@ -15122,12 +15122,16 @@ TCL_CONFIG=${libdir}/tclConfig.sh
 
 # Check whether --with-tcl was given.
 if test "${with_tcl+set}" = set; then :
-  withval=$with_tcl;
-fi
-
-
-if test -e $TCL_CONFIG; then
-    . ${TCL_CONFIG}; # get TCL_VERSION
+  withval=$with_tcl; if test -e $TCL_CONFIG; then
+    source ${TCL_CONFIG} # get TCL_VERSION
+    if test "${with_tcl}" = "yes"; then
+        TCL_CFLAGS="${TCL_INCLUDE_SPEC}"
+        TCL_LIBS="${TCL_LIB_SPEC}"
+    else
+        TCL_CFLAGS="-I${with_tcl}/include"
+        TCL_LIBS="-L${with_tcl}/lib -ltcl"
+    fi
+    CPPFLAGS="$CPPFLAGS $TCL_CFLAGS"
     for ac_header in tcl.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "tcl.h" "ac_cv_header_tcl_h" "$ac_includes_default"
@@ -15172,12 +15176,8 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tcl_Tcl_CreateInterp" >&5
 $as_echo "$ac_cv_lib_tcl_Tcl_CreateInterp" >&6; }
 if test "x$ac_cv_lib_tcl_Tcl_CreateInterp" = x""yes; then :
-  if test x$with_tcl = x; then
-                        TCL_LIBS="-ltcl"
-                      else
-                        TCL_CFLAGS="-I${TCL_DIR}/include"
-                        TCL_LIBS="-L${TCL_DIR}/lib -ltcl"
-                      fi
+
+            tcl_found="yes"
 
 fi
 
@@ -15186,7 +15186,7 @@ fi
 
 done
 
-    if test "x$TCL_LIBS" != "x"; then
+    if test "x${tcl_found}" != "x"; then
 
 $as_echo "#define HAVE_LIBTCL /**/" >>confdefs.h
 
@@ -15196,6 +15196,9 @@ $as_echo "#define HAVE_LIBTCL /**/" >>confdefs.h
     fi
 fi
 
+fi
+
+
 ################################
 # Check for inclusion of lub_heap
 ################################
@@ -15216,14 +15219,14 @@ else
 fi
 
 
-if test x$enable_lubheap = xyes; then
+if test "x$enable_lubheap" = "xyes"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Replacing standard memory libraries with lubheap" >&5
 $as_echo "$as_me: WARNING: Replacing standard memory libraries with lubheap" >&2;}
 
     LUBHEAP_LIBS="-llubheap"
     LUBHEAP_CFLAGS=""
 
-    if test x$LUBHEAP_LIBS = x; then
+    if test "x$LUBHEAP_LIBS" = "x"; then
         as_fn_error "Cannot find the \"Little Useful Bits Heap\" library" "$LINENO" 5
     fi
 
@@ -15241,7 +15244,7 @@ else
 fi
 
 
-if test x$enable_gpl = xyes; then
+if test "x$enable_gpl" = "xyes"; then
     ################################
     # Check for BFD library
     ################################

+ 26 - 24
configure.ac

@@ -55,7 +55,7 @@ AM_CONDITIONAL(DEBUG,test x$enable_debug = xyes)
 LUB_LIBS="-llub"
 LUB_CFLAGS=""
 
-if test x$LUB_LIBS = x; then
+if test "x$LUB_LIBS" = "x"; then
     AC_MSG_ERROR([Cannot find the "Little Useful Bits" library])
 fi
 AC_SUBST(LUB_LIBS)
@@ -67,7 +67,7 @@ AC_SUBST(LUB_CFLAGS)
 KONF_LIBS="-lkonf"
 KONF_CFLAGS=""
 
-if test x$KONF_LIBS = x; then
+if test "x$KONF_LIBS" = "x"; then
     AC_MSG_ERROR([Cannot find the "CLI config" library])
 fi
 AC_SUBST(KONF_LIBS)
@@ -79,7 +79,7 @@ AC_SUBST(KONF_CFLAGS)
 TINYRL_LIBS="-ltinyrl"
 TINYRL_CFLAGS=""
 
-if test x$TINYRL_LIBS = x; then
+if test "x$TINYRL_LIBS" = "x"; then
     AC_MSG_ERROR([Cannot find the "Tiny Readline" library])
 fi
 AC_SUBST(TINYRL_LIBS)
@@ -91,7 +91,7 @@ AC_SUBST(TINYRL_CFLAGS)
 TINYXML_LIBS="-ltinyxml"
 TINYXML_CXXFLAGS="-std=gnu++98"
 
-if test x$TINYXML_LIBS = x; then
+if test "x$TINYXML_LIBS" = "x"; then
     AC_MSG_ERROR([Cannot find the "Tiny XML" library])
 fi
 AC_SUBST(TINYXML_LIBS)
@@ -109,7 +109,7 @@ AC_CHECK_HEADERS(pthread.h,
                  [AC_CHECK_LIB(pthread, 
                               pthread_create, 
                               [AC_DEFINE([HAVE_LIBPTHREAD], [], [Have POSIX threads library])
-                                if test x$with_pthread = x; then
+                                if test "x$with_pthread" = "x"; then
                                     PTHREAD_LIBS="-lpthread"
                                 else
                                     PTHREAD_CFLAGS="-I$with_pthread/include"
@@ -120,7 +120,7 @@ AC_CHECK_HEADERS(pthread.h,
                               ])
                  ])
 
-if test x$PTHREAD_LIBS = x; then
+if test "x$PTHREAD_LIBS" = "x"; then
     AC_MSG_ERROR([Cannot find the POSIX threads library])
 fi
 
@@ -135,7 +135,7 @@ AC_CHECK_LIB(rt,
              clock_gettime, 
              [
                 AC_DEFINE([HAVE_LIBRT], [], [Have POSIX real time library])
-                if test x$with_rt = x; then
+                if test "x$with_rt" = "x"; then
                     RT_LIBS="-lrt"
                 else
                     RT_CFLAGS="-I$with_rt/include"
@@ -152,28 +152,30 @@ TCL_CONFIG=${libdir}/tclConfig.sh
 
 AC_ARG_WITH(tcl,
             [AS_HELP_STRING([--with-tcl=DIR],
-                            [Use TCL library distribution in DIR])])
-
+                            [Use TCL library distribution in DIR])],
 if test -e $TCL_CONFIG; then
-    . ${TCL_CONFIG}; # get TCL_VERSION
+    source ${TCL_CONFIG} # get TCL_VERSION
+    if test "${with_tcl}" = "yes"; then
+        TCL_CFLAGS="${TCL_INCLUDE_SPEC}"
+        TCL_LIBS="${TCL_LIB_SPEC}"
+    else
+        TCL_CFLAGS="-I${with_tcl}/include"
+        TCL_LIBS="-L${with_tcl}/lib -ltcl"
+    fi
+    CPPFLAGS="$CPPFLAGS $TCL_CFLAGS"
     AC_CHECK_HEADERS(tcl.h,
-        AC_CHECK_LIB(tcl, 
-                     Tcl_CreateInterp, 
-                     [if test x$with_tcl = x; then
-                        TCL_LIBS="-ltcl"
-                      else
-                        TCL_CFLAGS="-I${TCL_DIR}/include"
-                        TCL_LIBS="-L${TCL_DIR}/lib -ltcl"
-                      fi
-                     ])
-        )
-    if test "x$TCL_LIBS" != "x"; then
+        AC_CHECK_LIB(tcl, Tcl_CreateInterp, [
+            tcl_found="yes"
+        ])
+    )
+    if test "x${tcl_found}" != "x"; then
             AC_DEFINE([HAVE_LIBTCL], [], [Have TCL library])
             AC_SUBST(TCL_CFLAGS)
             AC_SUBST(TCL_LIBS)
             AC_SUBST(TCL_VERSION)
     fi
 fi
+)
 
 ################################
 # Check for inclusion of lub_heap
@@ -186,13 +188,13 @@ AC_ARG_ENABLE(lubheap,
 
 AM_CONDITIONAL(LUBHEAP,test x$enable_lubheap = xyes)
 
-if test x$enable_lubheap = xyes; then
+if test "x$enable_lubheap" = "xyes"; then
     AC_MSG_WARN([Replacing standard memory libraries with lubheap])
 
     LUBHEAP_LIBS="-llubheap"
     LUBHEAP_CFLAGS=""
 
-    if test x$LUBHEAP_LIBS = x; then
+    if test "x$LUBHEAP_LIBS" = "x"; then
         AC_MSG_ERROR([Cannot find the "Little Useful Bits Heap" library])
     fi
     AC_SUBST(LUBHEAP_LIBS)
@@ -208,7 +210,7 @@ AC_ARG_ENABLE(gpl,
     [],
     [enable_gpl=yes])
 
-if test x$enable_gpl = xyes; then
+if test "x$enable_gpl" = "xyes"; then
     ################################
     # Check for BFD library
     ################################