diff options
| author | david <[email protected]> | 2026-07-24 18:40:14 -0300 |
|---|---|---|
| committer | david <[email protected]> | 2026-07-24 18:40:14 -0300 |
| commit | 9e5372a6db4334d9ff7da1a0f949cdb359ab6de1 (patch) | |
| tree | f28c6ae859043cd3e3a587aeee24a69eeff94445 /configure.ac | |
| parent | d64804517b2b0a9e57098b2fd2685626723193a1 (diff) | |
| download | petratc-9e5372a6db4334d9ff7da1a0f949cdb359ab6de1.tar.gz petratc-9e5372a6db4334d9ff7da1a0f949cdb359ab6de1.zip | |
CONFIGURE YAYY BETTER BUILD METHODS lslsls! ANYTHING BUT WRITING ACTUAL CODElslslslslslslslslslslslslslslsls
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..c22473c --- /dev/null +++ b/configure.ac @@ -0,0 +1,24 @@ +AC_INIT([petratc], [1.0]) +AC_CONFIG_SRCDIR([petratc.c]) +AC_PROG_CC + +#what if i have pdcurses or just curses and not ncurses idk +#this will be useful only when i decide to port it to widnows +CURSES_LIB="" +AC_CHECK_LIB([ncursesw], [initscr], [CURSES_LIB="-lncursesw"]) +AS_IF([test "x$CURSES_LIB" = "x"], + [AC_CHECK_LIB([ncurses], [initscr], [CURSES_LIB="-lncurses"])]) +AS_IF([test "x$CURSES_LIB" = "x"], + [AC_CHECK_LIB([curses], [initscr], [CURSES_LIB="-lcurses"])]) +AS_IF([test "x$CURSES_LIB" = "x"], + [AC_CHECK_LIB([pdcurses], [initscr], [CURSES_LIB="-lpdcurses"])]) +AS_IF([test "x$CURSES_LIB" = "x"], + [AC_MSG_ERROR([no curses library found (tried ncursesw, ncurses, curses, pdcurses)])]) + +#in mac having -ltinfo in your makefile gives you a linker error +#whereas in linux you need it +AC_CHECK_LIB([tinfo], [setupterm], [CURSES_LIB="$CURSES_LIB -ltinfo"]) + +AC_SUBST([CURSES_LIB]) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT |
