diff --git a/configure.ac b/configure.ac index f96ccf2..238b9b2 100644 --- a/configure.ac +++ b/configure.ac @@ -21,20 +21,16 @@ AC_ARG_ENABLE(ncurses, USE_SLANG=false USE_NCURSES=false -if test "${enable_ncurses}" = "yes" -then +if test "${enable_ncurses}" = "yes"; then AC_CHECK_HEADER(ncurses.h,:,AC_MSG_ERROR([cannot find ncurses headers])) AC_CHECK_LIB(ncurses,initscr,:,AC_MSG_ERROR([cannot find ncurses library])) + AC_DEFINE(USE_NCURSES, 1, Define if the backend driver is ncurses) USE_NCURSES=: -else - if test "${enable_slang}" != "no" - then - AC_CHECK_HEADER(slang.h,:,AC_MSG_ERROR([cannot find slang headers])) - AC_CHECK_LIB(slang,SLkp_init,:,AC_MSG_ERROR([cannot find slang library])) - USE_SLANG=: - else - : - fi +elif test "${enable_slang}" != "no"; then + AC_CHECK_HEADER(slang.h,:,AC_MSG_ERROR([cannot find slang headers])) + AC_CHECK_LIB(slang,SLkp_init,:,AC_MSG_ERROR([cannot find slang library])) + AC_DEFINE(USE_SLANG, 1, Define if the backend driver is slang) + USE_SLANG=: fi AM_CONDITIONAL(USE_SLANG, ${USE_SLANG}) diff --git a/libee/Makefile.am b/libee/Makefile.am index 2bf265e..36bbe51 100644 --- a/libee/Makefile.am +++ b/libee/Makefile.am @@ -7,13 +7,6 @@ AM_CFLAGS = -g -O2 -fno-strength-reduce -fomit-frame-pointer # Code qui fait des warnings == code de porc == deux baffes dans ta gueule AM_CFLAGS += -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -if USE_SLANG -CPPFLAGS_slang = -DUSE_SLANG -endif -if USE_NCURSES -CPPFLAGS_ncurses = -DUSE_NCURSES -endif - lib_LIBRARIES = libee.a libee_a_SOURCES = \ ee.c \ @@ -24,5 +17,4 @@ libee_a_SOURCES = \ circle.c \ triangle.c \ $(NULL) -libee_a_CPPFLAGS = $(CPPFLAGS_slang) $(CPPFLAGS_ncurses) diff --git a/src/Makefile.am b/src/Makefile.am index 0d05759..725ad26 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -8,11 +8,9 @@ AM_CFLAGS = -g -O2 -fno-strength-reduce -fomit-frame-pointer AM_CFLAGS += -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs if USE_SLANG -CPPFLAGS_slang = -DUSE_SLANG LDFLAGS_slang = -lslang endif if USE_NCURSES -CPPFLAGS_ncurses = -DUSE_NCURSES LDFLAGS_ncurses = -lncurses endif @@ -34,6 +32,6 @@ ttyvaders_SOURCES = \ weapons.c \ $(NULL) -ttyvaders_CPPFLAGS = -I../libee $(CPPFLAGS_slang) $(CPPFLAGS_ncurses) +ttyvaders_CPPFLAGS = -I../libee ttyvaders_LDADD = ../libee/libee.a $(LDFLAGS_slang) $(LDFLAGS_ncurses) diff --git a/test/Makefile.am b/test/Makefile.am index 665913f..bd65ff8 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -8,17 +8,15 @@ AM_CFLAGS = -g -O2 -fno-strength-reduce -fomit-frame-pointer AM_CFLAGS += -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs if USE_SLANG -CPPFLAGS_slang = -DUSE_SLANG LDFLAGS_slang = -lslang endif if USE_NCURSES -CPPFLAGS_ncurses = -DUSE_NCURSES LDFLAGS_ncurses = -lncurses endif bin_PROGRAMS = demo demo_SOURCES = demo.c -demo_CPPFLAGS = -I../libee $(CPPFLAGS_slang) $(CPPFLAGS_ncurses) +demo_CPPFLAGS = -I../libee demo_LDADD = ../libee/libee.a $(LDFLAGS_slang) $(LDFLAGS_ncurses) -lm