move resize.c into lib-ui.
authorPierre Habouzit <madcoder@debian.org>
Sun, 12 Nov 2006 14:53:02 +0000 (15:53 +0100)
committerPierre Habouzit <madcoder@debian.org>
Sun, 12 Nov 2006 14:53:02 +0000 (15:53 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Makefile.am
configure.ac
lib-ui/Makefile.am
lib-ui/resize.c [moved from resize.c with 92% similarity]

index 38fc40b..f34b0e2 100644 (file)
@@ -60,7 +60,7 @@ INCLUDES=-I. -I$(top_srcdir) $(IMAP_INCLUDES) $(NNTP_INCLUDES) $(GPGME_CFLAGS) -
 CPPFLAGS=@CPPFLAGS@ -I$(includedir)
 
 EXTRA_madmutt_SOURCES = \
-       account.c mutt_sasl.c resize.c dotlock.c remailer.c \
+       account.c mutt_sasl.c dotlock.c remailer.c \
        alias.h browser.h mbyte.h remailer.h url.h state.h \
        mutt_idna.h mutt_libesmtp.c sidebar.h state.h
 
index 35dc32d..2a615d1 100644 (file)
@@ -165,60 +165,55 @@ main ()
         fi
         AC_DEFINE(USE_SLANG_CURSES,1, [ Define if you compile with SLang instead of curses/ncurses. ])
         AC_DEFINE(HAVE_COLOR,1,[ Define if your curses library supports color. ])
-        MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS resize.o"
 
         dnl --- now that we've found it, check the link
 
         AC_CHECK_LIB(slang, SLtt_get_terminfo,
             [MUTTLIBS="$MUTTLIBS -lslang -lm"],
             [AC_MSG_ERROR(unable to compile.  check config.log)], -lm)
-        ],
+    ],
+    [   mutt_cv_curses=/usr
+        AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses=DIR], [Where ncurses is installed]), [
+            if test $withval != yes; then
+                mutt_cv_curses=$withval
+            fi
+            if test x$mutt_cv_curses != x/usr; then
+                LDFLAGS="-L${mutt_cv_curses}/lib $LDFLAGS"
+                CPPFLAGS="$CPPFLAGS -I${mutt_cv_curses}/include"
+            fi
+        ])
 
-        [   mutt_cv_curses=/usr
-            AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses=DIR], [Where ncurses is installed]),
-            [   if test $withval != yes; then
-                    mutt_cv_curses=$withval
-                fi
-                if test x$mutt_cv_curses != x/usr; then
-                    LDFLAGS="-L${mutt_cv_curses}/lib $LDFLAGS"
-                    CPPFLAGS="$CPPFLAGS -I${mutt_cv_curses}/include"
+        AC_CHECK_FUNC(initscr,,[
+        cf_ncurses="ncurses"
+        for lib in ncursesw ncurses; do
+            AC_CHECK_LIB($lib, waddnwstr, [cf_ncurses="$lib"; break])
+        done
+        AC_CHECK_LIB($cf_ncurses, initscr,
+            [   MUTTLIBS="$MUTTLIBS -l$cf_ncurses"
+                if test x$mutt_cv_curses = x/usr -a -d /usr/include/ncurses; then
+                    CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses"
                 fi
-            ])
-
-            AC_CHECK_FUNC(initscr,,[
-            cf_ncurses="ncurses"
-            for lib in ncursesw ncurses; do
-                AC_CHECK_LIB($lib, waddnwstr, [cf_ncurses="$lib"; break])
-            done
-            AC_CHECK_LIB($cf_ncurses, initscr,
-                [   MUTTLIBS="$MUTTLIBS -l$cf_ncurses"
-                    if test x$mutt_cv_curses = x/usr -a -d /usr/include/ncurses; then
-                        CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses"
-                    fi
 
-                    if test "$cf_ncurses" = ncursesw; then
-                        AC_CHECK_HEADERS(ncurses/ncurses.h,[cf_cv_ncurses_header="ncurses/ncurses.h"])
-                        AC_CHECK_HEADERS(ncursesw/ncurses.h,[cf_cv_ncurses_header="ncursesw/ncurses.h"])
-                    else
-                        AC_CHECK_HEADERS(ncurses.h,[cf_cv_ncurses_header="ncurses.h"])
-                    fi
-                ],
-                [CF_CURSES_LIBS])
-            ])
-
-            old_LIBS="$LIBS"
-            LIBS="$LIBS $MUTTLIBS"
-            CF_CHECK_FUNCDECLS([#include <${cf_cv_ncurses_header-curses.h}>],
-                               [start_color typeahead bkgdset curs_set meta use_default_colors resizeterm])
-            if test "$ac_cv_func_decl_start_color" = yes; then
-                AC_DEFINE(HAVE_COLOR,1,[ Define if your curses library supports color. ])
-            fi
-            if test "$ac_cv_func_decl_resizeterm" = yes; then
-                MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS resize.o"
-            fi
-            LIBS="$old_LIBS"
+                if test "$cf_ncurses" = ncursesw; then
+                    AC_CHECK_HEADERS(ncurses/ncurses.h,[cf_cv_ncurses_header="ncurses/ncurses.h"])
+                    AC_CHECK_HEADERS(ncursesw/ncurses.h,[cf_cv_ncurses_header="ncursesw/ncurses.h"])
+                else
+                    AC_CHECK_HEADERS(ncurses.h,[cf_cv_ncurses_header="ncurses.h"])
+                fi
+            ],
+            [CF_CURSES_LIBS])
         ])
 
+        old_LIBS="$LIBS"
+        LIBS="$LIBS $MUTTLIBS"
+        CF_CHECK_FUNCDECLS([#include <${cf_cv_ncurses_header-curses.h}>],
+                           [start_color typeahead bkgdset curs_set meta use_default_colors resizeterm])
+        if test "$ac_cv_func_decl_start_color" = yes; then
+            AC_DEFINE(HAVE_COLOR,1,[ Define if your curses library supports color. ])
+        fi
+        LIBS="$old_LIBS"
+    ])
+
 AC_CHECK_HEADERS(stdarg.h sys/ioctl.h ioctl.h sysexits.h)
 AC_CHECK_HEADERS(sys/time.h sys/resource.h)
 AC_CHECK_HEADERS(unix.h)
index be41b0b..77a8037 100644 (file)
@@ -2,7 +2,7 @@ noinst_LIBRARIES = libui.a
 
 libui_a_SOURCES = curses.h     \
                  enter.h menu.h                                             \
-                 enter.c menu.c color.c curs_lib.c curs_main.c
+                 enter.c menu.c color.c curs_lib.c curs_main.c resize.c
 
 noinst_HEADERS  = curses.h      \
                  enter.h menu.h
similarity index 92%
rename from resize.c
rename to lib-ui/resize.c
index 1c7febb..82fe316 100644 (file)
--- a/resize.c
@@ -11,6 +11,8 @@
 # include "config.h"
 #endif
 
+#if defined(USE_SLANG_CURSES) || defined(HAVE_RESIZETERM)
+
 #include <lib-ui/curses.h>
 
 #include "mutt.h"
@@ -71,3 +73,5 @@ void mutt_resize_screen (void)
   resizeterm (SLtt_Screen_Rows, SLtt_Screen_Cols);
 #endif
 }
+
+#endif /* defined(USE_SLANG_CURSES) || defined(HAVE_RESIZETERM) */