0

I am creating .deb package from source .tar.gz I have done all the steps, and at last I ran this command fakeroot dpkg-buildpackage -F to build the package, at the final step during linking error is thrown with message undefined reference to symbol 'pthread_create@@GLIBC_2.2.5 which means I need to add -pthread to compiler flag, but I dont understand how to add this I tried to documents of dpkg-buildflags but they are very confusing and I m not able to understand how to do this.

debian/rule file

#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
#DPKG_EXPORT_BUILDFLAGS = 1
#include /usr/share/dpkg/buildflags.mk
# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

override_dh_auto_configure:
        env | sort
        dh_auto_configure --buildsystem=cmake -- -DBUILD_TESTING=OFF -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true -DHUNTER_ENABLED=OFF
%:
        dh $@


# dh_make generated override targets
# This is example for Cmake (See https://bugs.debian.org/641051 )
#override_dh_auto_configure:
#       dh_auto_configure -- #  -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)

Braiam
  • 1
  • 11
  • 47
  • 78
Abhinav Singh
  • 302
  • 3
  • 15

1 Answers1

0

Yeah so I got the answer, uncomment this export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic -pthread and this #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -pthread this will add the flag -pthread

Abhinav Singh
  • 302
  • 3
  • 15