Change buildsystem to build a library
- Build a library and a binary. - Remove lto for now. - Remove some other compiler arguments. - Mention that cairo is a dependency for now in README.
This commit is contained in:
parent
1a5245e4db
commit
56f7176c91
@ -39,6 +39,10 @@ $ ./configure
|
|||||||
$ make -j
|
$ make -j
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Since no sensible functionality independent of cairo is implemented as of now,
|
||||||
|
cairo is a hard dependency. On NixOS the included `shell.nix` script can be
|
||||||
|
used to bring the dependencies and a couple of development tools intos cope.
|
||||||
|
|
||||||
HTML documentation can be generated with `make html` if Doxygen is
|
HTML documentation can be generated with `make html` if Doxygen is
|
||||||
installed.
|
installed.
|
||||||
|
|
||||||
|
19
configure.ac
19
configure.ac
@ -17,6 +17,10 @@ AX_CHECK_COMPILE_FLAG([-std=c11],
|
|||||||
[ CFLAGS+=" -std=c11" ],
|
[ CFLAGS+=" -std=c11" ],
|
||||||
[ AC_MSG_ERROR([C compiler doesn't support C11 mode])] )
|
[ AC_MSG_ERROR([C compiler doesn't support C11 mode])] )
|
||||||
|
|
||||||
|
# Other tools
|
||||||
|
AC_PROG_RANLIB
|
||||||
|
AM_PROG_AR
|
||||||
|
|
||||||
# Checks for header files.
|
# Checks for header files.
|
||||||
AC_CHECK_HEADERS([assert.h math.h stdint.h stdlib.h stdbool.h stdio.h])
|
AC_CHECK_HEADERS([assert.h math.h stdint.h stdlib.h stdbool.h stdio.h])
|
||||||
|
|
||||||
@ -32,13 +36,10 @@ AC_FUNC_MALLOC
|
|||||||
AC_FUNC_REALLOC
|
AC_FUNC_REALLOC
|
||||||
AC_CHECK_FUNCS([memmove memset mkdir pow strchr strdup strstr strtol])
|
AC_CHECK_FUNCS([memmove memset mkdir pow strchr strdup strstr strtol])
|
||||||
|
|
||||||
# User defined options: debug, lto
|
# User defined options: debug
|
||||||
AC_ARG_ENABLE([debug],
|
AC_ARG_ENABLE([debug],
|
||||||
[AS_HELP_STRING([--enable-debug],[compile with debug options])],
|
[AS_HELP_STRING([--enable-debug],[compile with debug options])],
|
||||||
[debug=${enableval}], [debug=no])
|
[debug=${enableval}], [debug=no])
|
||||||
AC_ARG_ENABLE([lto],
|
|
||||||
[AS_HELP_STRING([--disable-lto], [disable link time optimization])],
|
|
||||||
[lto=${enableval}], [lto=yes])
|
|
||||||
|
|
||||||
# Libraries
|
# Libraries
|
||||||
PKG_CHECK_MODULES([CAIRO], [cairo])
|
PKG_CHECK_MODULES([CAIRO], [cairo])
|
||||||
@ -52,19 +53,9 @@ if test x$debug = xyes; then
|
|||||||
CFLAGS+=" -ftrapv"
|
CFLAGS+=" -ftrapv"
|
||||||
CPPFLAGS+="-DDEBUG"
|
CPPFLAGS+="-DDEBUG"
|
||||||
YFLAGS+=" --debug -v"
|
YFLAGS+=" --debug -v"
|
||||||
lto=no
|
|
||||||
else
|
else
|
||||||
CFLAGS+=" -O3"
|
CFLAGS+=" -O3"
|
||||||
CPPFLAGS+=" -DNDEBUG"
|
CPPFLAGS+=" -DNDEBUG"
|
||||||
CFLAGS+=" -fomit-frame-pointer"
|
|
||||||
AX_CHECK_COMPILE_FLAG([-finline-limit=1000000 ],
|
|
||||||
[ CFLAGS+=" -finline-limit=1000000" ])
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test x$lto = xyes; then
|
|
||||||
AX_CHECK_COMPILE_FLAG([-flto],
|
|
||||||
[ CFLAGS+=" -flto" ],
|
|
||||||
[ AC_MSG_WARN([C compiler doesn't support link time optimization])] )
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile src/Makefile])
|
AC_CONFIG_FILES([Makefile src/Makefile])
|
||||||
|
@ -15,6 +15,6 @@ pkgs.stdenv.mkDerivation {
|
|||||||
name = "hvif-light";
|
name = "hvif-light";
|
||||||
|
|
||||||
hardeningDisable = [ "all" ];
|
hardeningDisable = [ "all" ];
|
||||||
buildInputs = with pkgs; [ autoconf automake gcc clang-tools gdb valgrind-light pkg-config cairo doxygen ];
|
buildInputs = with pkgs; [ autoconf automake gcc clang-tools gdb valgrind-light pkg-config cairo doxygen libtool ];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
NULL =
|
NULL =
|
||||||
|
|
||||||
bin_PROGRAMS = hvif
|
bin_PROGRAMS = hvif
|
||||||
|
lib_LIBRARIES = libhviflight.a
|
||||||
|
|
||||||
# hvif configuration
|
# hvif configuration
|
||||||
hvif_CFLAGS = \
|
hvif_CFLAGS = \
|
||||||
@ -13,16 +14,36 @@ hvif_CPPFLAGS = \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
hvif_LDADD = \
|
hvif_LDADD = \
|
||||||
$(AM_LDADD) \
|
$(AM_LDADD) \
|
||||||
-lm \
|
|
||||||
$(CAIRO_LIBS) \
|
$(CAIRO_LIBS) \
|
||||||
|
-lm \
|
||||||
|
libhviflight.a \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
# libhviflight.a configuration
|
||||||
|
libhviflight_a_CFLAGS = \
|
||||||
|
$(AM_CFLAGS) \
|
||||||
|
$(CAIRO_CFLAGS) \
|
||||||
|
$(NULL)
|
||||||
|
libhviflight_a_CPPFLAGS = \
|
||||||
|
$(AM_CPPFLAGS) \
|
||||||
|
-I$(top_builddir)/src \
|
||||||
|
$(NULL)
|
||||||
|
libhviflight_a_LIBADD = \
|
||||||
|
$(AM_LIBAD) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
libhviflight_a_SOURCES = \
|
||||||
|
$(BUILT_SOURCES) \
|
||||||
|
src/hvif-light.c \
|
||||||
|
src/hvif-light.h \
|
||||||
|
src/hvif-cairo.c \
|
||||||
|
src/hvif-cairo.h \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
hvif_SOURCES = \
|
hvif_SOURCES = \
|
||||||
$(BUILT_SOURCES) \
|
$(BUILT_SOURCES) \
|
||||||
src/main.c \
|
src/main.c \
|
||||||
src/hvif-light.c \
|
|
||||||
src/hvif-light.h \
|
src/hvif-light.h \
|
||||||
src/hvif-cairo.c \
|
|
||||||
src/hvif-cairo.h \
|
src/hvif-cairo.h \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user