diff --git a/Makefile.am b/Makefile.am index 160df28..aad6130 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,10 +6,17 @@ AM_CPPFLAGS = -I$(top_srcdir)/include AM_CFLAGS = @VLIBC_CFLAGS@ # ---- Library ------------------------------------------------------------- -vlibc_include_HEADERS = include/vlibc.h +vlibc_include_HEADERS = include/vlibc.h include/stddef.h include/string.h vlibc_lib_LTLIBRARIES = libvlibc.la -libvlibc_la_SOURCES = src/vlibc.c +libvlibc_la_SOURCES = src/vlibc.c src/string/strlen.c src/string/strcmp.c \ + src/string/memcpy.c src/string/memmove.c src/string/memset.c +if PROFILE_GE_2 +libvlibc_la_SOURCES += src/string/strlcpy.c src/string/strlcat.c +endif +if PROFILE_GE_3 +libvlibc_la_SOURCES += src/string/strcasestr.c +endif libvlibc_la_LDFLAGS = -version-info 0:0:0 -no-undefined # Install location depends on the install method (see configure.ac). @@ -21,6 +28,13 @@ vlibc_includedir = $(prefix)/lib/vlibc/include vlibc_libdir = $(prefix)/lib/vlibc/lib endif +# Generated per-profile feature header (see configure.ac); installed under +# $(vlibc_includedir)/vlibc/. A dedicated primary is used because +# nodist_nobase_vlibc_include_HEADERS is rejected by automake (the "nobase" +# prefix is unsupported for this directory) and loses the vlibc/ path. +vlibc_featuresdir = $(vlibc_includedir)/vlibc +nodist_vlibc_features_HEADERS = include/vlibc/features.h + # ---- Compiler drivers ---------------------------------------------------- bin_SCRIPTS = tools/vlibc-gcc tools/vlibc-clang diff --git a/configure b/configure index 55fcbc1..754a2d2 100755 --- a/configure +++ b/configure @@ -679,6 +679,10 @@ MUSL_CC vlibc_install_mode INSTALL_OVERWRITE_FALSE INSTALL_OVERWRITE_TRUE +PROFILE_GE_3_FALSE +PROFILE_GE_3_TRUE +PROFILE_GE_2_FALSE +PROFILE_GE_2_TRUE vlibc_level vlibc_profile VLIBC_CFLAGS @@ -5285,6 +5289,23 @@ esac + if test "$vlibc_level" -ge 2; then + PROFILE_GE_2_TRUE= + PROFILE_GE_2_FALSE='#' +else + PROFILE_GE_2_TRUE='#' + PROFILE_GE_2_FALSE= +fi + + if test "$vlibc_level" -ge 3; then + PROFILE_GE_3_TRUE= + PROFILE_GE_3_FALSE='#' +else + PROFILE_GE_3_TRUE='#' + PROFILE_GE_3_FALSE= +fi + + # ---- Install method ------------------------------------------------------ # "alongside" installs vlibc next to the system libc: headers and libraries go # under a vlibc-specific tree, used via the vlibc-gcc / vlibc-clang drivers. @@ -14586,6 +14607,14 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${PROFILE_GE_2_TRUE}" && test -z "${PROFILE_GE_2_FALSE}"; then + as_fn_error $? "conditional \"PROFILE_GE_2\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${PROFILE_GE_3_TRUE}" && test -z "${PROFILE_GE_3_FALSE}"; then + as_fn_error $? "conditional \"PROFILE_GE_3\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${INSTALL_OVERWRITE_TRUE}" && test -z "${INSTALL_OVERWRITE_FALSE}"; then as_fn_error $? "conditional \"INSTALL_OVERWRITE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/configure.ac b/configure.ac index fc3c996..9bbf7dc 100644 --- a/configure.ac +++ b/configure.ac @@ -118,6 +118,9 @@ AS_CASE([$vlibc_profile], AC_SUBST([vlibc_profile]) AC_SUBST([vlibc_level]) +AM_CONDITIONAL([PROFILE_GE_2], [test "$vlibc_level" -ge 2]) +AM_CONDITIONAL([PROFILE_GE_3], [test "$vlibc_level" -ge 3]) + # ---- Install method ------------------------------------------------------ # "alongside" installs vlibc next to the system libc: headers and libraries go # under a vlibc-specific tree, used via the vlibc-gcc / vlibc-clang drivers.