diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2019-02-12 17:25:23 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2019-03-07 12:46:31 +0100 |
commit | 675b9b536871aebcce3372923244d2b27b6e185f (patch) | |
tree | 8ae8868d46771e7384a6ac0596b58c0bd6f5e26e /configure | |
parent | 12f8beeb9f2b12b351ea096a296da543adc6954d (diff) |
build-sys: link with slirp as an external project
Use the "system" libslirp if its present or requested.
Else build with a static libslirp.a if slirp/ is checked
out ("internal") or a submodule ("git").
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20190212162524.31504-7-marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 65 |
1 files changed, 62 insertions, 3 deletions
@@ -406,7 +406,7 @@ includedir="\${prefix}/include" sysconfdir="\${prefix}/etc" local_statedir="\${prefix}/var" confsuffix="/qemu" -slirp="yes" +slirp="" oss_lib="" bsd="no" linux="no" @@ -1105,6 +1105,10 @@ for opt do ;; --disable-slirp) slirp="no" ;; + --enable-slirp=git) slirp="git" + ;; + --enable-slirp=system) slirp="system" + ;; --disable-vde) vde="no" ;; --enable-vde) vde="yes" @@ -5755,6 +5759,55 @@ if test "$libpmem" != "no"; then fi ########################################## +# check for slirp + +case "$slirp" in + "" | yes) + if $pkg_config slirp; then + slirp=system + elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then + slirp=git + elif test -e "${source_path}/slirp/Makefile" ; then + slirp=internal + elif test -z "$slirp" ; then + slirp=no + else + feature_not_found "slirp" "Install slirp devel or git submodule" + fi + ;; + + system) + if ! $pkg_config slirp; then + feature_not_found "slirp" "Install slirp devel" + fi + ;; +esac + +case "$slirp" in + git | internal) + if test "$slirp" = git; then + git_submodules="${git_submodules} slirp" + fi + mkdir -p slirp + slirp_cflags="-I\$(SRC_PATH)/slirp/src -I\$(BUILD_DIR)/slirp/src" + slirp_libs="-L\$(BUILD_DIR)/slirp -lslirp" + ;; + + system) + slirp_version=$($pkg_config --modversion slirp 2>/dev/null) + slirp_cflags=$($pkg_config --cflags slirp 2>/dev/null) + slirp_libs=$($pkg_config --libs slirp 2>/dev/null) + ;; + + no) + ;; + *) + error_exit "Unknown state for slirp: $slirp" + ;; +esac + + +########################################## # End of CC checks # After here, no more $cc or $ld runs @@ -6111,7 +6164,8 @@ echo "QEMU_LDFLAGS $QEMU_LDFLAGS" echo "make $make" echo "install $install" echo "python $python ($python_version)" -if test "$slirp" = "yes" ; then +echo "slirp support $slirp $(echo_version $slirp $slirp_version)" +if test "$slirp" != "no" ; then echo "smbd $smbd" fi echo "module support $modules" @@ -6372,9 +6426,14 @@ fi if test "$profiler" = "yes" ; then echo "CONFIG_PROFILER=y" >> $config_host_mak fi -if test "$slirp" = "yes" ; then +if test "$slirp" != "no"; then echo "CONFIG_SLIRP=y" >> $config_host_mak echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak + echo "SLIRP_CFLAGS=$slirp_cflags" >> $config_host_mak + echo "SLIRP_LIBS=$slirp_libs" >> $config_host_mak +fi +if [ "$slirp" = "git" -o "$slirp" = "internal" ]; then + echo "config-host.h: subdir-slirp" >> $config_host_mak fi if test "$vde" = "yes" ; then echo "CONFIG_VDE=y" >> $config_host_mak |