Building IKE-QTGUI into snap throws "flex: can't open conf.token.ll"

Im trying to get the ShrewSoft VPN app into a snap, and this is my first snap btw. Im running into an issue when the snap compiles itself, it gets past the ./configure part and during cmake, it errors out at around ~30%-~40%.

This is the entire output:

snap@snapdev:~/Documents$ snapcraft 
Pulling ike 
Building ike 
cmake /home/snap/Documents/parts/ike/src -DCMAKE_INSTALL_PREFIX= -DCMAKE_INSTALL_PREFIX=/usr -DQTGUI=YES -DETCDIR=/etc -DNATT=YES
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using install prefix /usr ...
-- Using etc install path /etc ...
-- Using bin install path /usr/bin ...
-- Using sbin install path /usr/sbin ...
-- Using lib install path /usr/lib ...
-- Using man install path /usr/local/man ...
-- Looking for crypt in crypt
-- Looking for crypt in crypt - found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Using library -lpthread
-- Looking for pthread_mutex_timedlock in -lpthread
-- Looking for pthread_mutex_timedlock in -lpthread - found
-- Using binary /usr/bin/flex ...
-- Using binary /usr/bin/bison ...
CMake Warning (dev) at source/iked/CMakeLists.txt:111 (add_custom_command):
  Policy CMP0050 is not set: Disallow add_custom_command SOURCE signatures.
  Run "cmake --help-policy CMP0050" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The SOURCE signatures of add_custom_command are no longer supported.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at source/iked/CMakeLists.txt:120 (add_custom_command):
  Policy CMP0050 is not set: Disallow add_custom_command SOURCE signatures.
  Run "cmake --help-policy CMP0050" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The SOURCE signatures of add_custom_command are no longer supported.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/snap/Documents/parts/ike/build
make -j1
Scanning dependencies of target ss_ith
[  1%] Building CXX object source/libith/CMakeFiles/ss_ith.dir/libith.o
[  3%] Linking CXX shared library libss_ith.so
[  3%] Built target ss_ith
Scanning dependencies of target ss_log
[  4%] Building CXX object source/liblog/CMakeFiles/ss_log.dir/liblog.o
[  6%] Linking CXX shared library libss_log.so
[  6%] Built target ss_log
Scanning dependencies of target ss_idb
[  7%] Building CXX object source/libidb/CMakeFiles/ss_idb.dir/libidb.o
[  9%] Building CXX object source/libidb/CMakeFiles/ss_idb.dir/base64.o
[ 10%] Linking CXX shared library libss_idb.so
[ 10%] Built target ss_idb
Scanning dependencies of target ss_pfk
[ 12%] Building CXX object source/libpfk/CMakeFiles/ss_pfk.dir/libpfk.o
[ 14%] Linking CXX shared library libss_pfk.so
[ 14%] Built target ss_pfk
Scanning dependencies of target ss_ike
[ 15%] Building CXX object source/libike/CMakeFiles/ss_ike.dir/client.o
[ 17%] Building CXX object source/libike/CMakeFiles/ss_ike.dir/config.o
[ 18%] Building CXX object source/libike/CMakeFiles/ss_ike.dir/manager.o
[ 20%] Building CXX object source/libike/CMakeFiles/ss_ike.dir/manager.file.o
[ 21%] Building CXX object source/libike/CMakeFiles/ss_ike.dir/libike.o
[ 23%] Linking CXX shared library libss_ike.so
[ 23%] Built target ss_ike
Scanning dependencies of target ss_ip
[ 25%] Building CXX object source/libip/CMakeFiles/ss_ip.dir/libip.frag.o
[ 26%] Building CXX object source/libip/CMakeFiles/ss_ip.dir/libip.packet.o
[ 28%] Building CXX object source/libip/CMakeFiles/ss_ip.dir/libip.packet.dns.o
[ 29%] Building CXX object source/libip/CMakeFiles/ss_ip.dir/libip.packet.ip.o
[ 31%] Building CXX object source/libip/CMakeFiles/ss_ip.dir/libip.packet.udp.o
[ 32%] Building CXX object source/libip/CMakeFiles/ss_ip.dir/libip.pcap.o
[ 34%] Building CXX object source/libip/CMakeFiles/ss_ip.dir/libip.queue.o
[ 35%] Building CXX object source/libip/CMakeFiles/ss_ip.dir/libip.route.o
[ 37%] Linking CXX shared library libss_ip.so
[ 37%] Built target ss_ip
[ 39%] Generating conf.token.cpp
flex: can't open conf.token.ll
source/iked/CMakeFiles/iked.dir/build.make:65: recipe for target 'source/iked/conf.token.cpp' failed
make[2]: *** [source/iked/conf.token.cpp] Error 1
CMakeFiles/Makefile2:91: recipe for target 'source/iked/CMakeFiles/iked.dir/all' failed
make[1]: *** [source/iked/CMakeFiles/iked.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
Failed to run 'make -j1' for 'ike': Exited with code 2.
Verify that the part is using the correct parameters and try again.

I have looked at the build.make file on line 65 as it mentions but i dont see what could cause the issue. However on CMakeError.log, it gives errors regarding a pthread_create. Im not too savy on compiling, anyone have any ideas what could be causing the issue?

CMakeError.log:

Determining if the pthread_create exist failed with the following output:
Change Dir: /home/snap/Documents/parts/ike/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_64b41/fast"
/usr/bin/make -f CMakeFiles/cmTC_64b41.dir/build.make CMakeFiles/cmTC_64b41.dir/build
make[1]: Entering directory '/home/snap/Documents/parts/ike/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_64b41.dir/CheckSymbolExists.c.o
/usr/bin/cc     -o CMakeFiles/cmTC_64b41.dir/CheckSymbolExists.c.o   -c /home/snap/Documents/parts/ike/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_64b41
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_64b41.dir/link.txt --verbose=1
/usr/bin/cc       CMakeFiles/cmTC_64b41.dir/CheckSymbolExists.c.o  -o cmTC_64b41 -rdynamic 
CMakeFiles/cmTC_64b41.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_64b41.dir/build.make:97: recipe for target 'cmTC_64b41' failed
make[1]: *** [cmTC_64b41] Error 1
make[1]: Leaving directory '/home/snap/Documents/parts/ike/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_64b41/fast' failed
make: *** [cmTC_64b41/fast] Error 2

File /home/snap/Documents/parts/ike/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/snap/Documents/parts/ike/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_44c50/fast"
/usr/bin/make -f CMakeFiles/cmTC_44c50.dir/build.make CMakeFiles/cmTC_44c50.dir/build
make[1]: Entering directory '/home/snap/Documents/parts/ike/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_44c50.dir/CheckFunctionExists.c.o
/usr/bin/cc    -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_44c50.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.5/Modules/CheckFunctionExists.c
Linking C executable cmTC_44c50
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_44c50.dir/link.txt --verbose=1
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create    CMakeFiles/cmTC_44c50.dir/CheckFunctionExists.c.o  -o cmTC_44c50 -rdynamic -lpthreads 
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_44c50.dir/build.make:97: recipe for target 'cmTC_44c50' failed
make[1]: *** [cmTC_44c50] Error 1
make[1]: Leaving directory '/home/snap/Documents/parts/ike/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_44c50/fast' failed
make: *** [cmTC_44c50/fast] Error 2

This is my snapcraft.yaml:

name: ike
version: '2.2.1'
summary: The Shewsoft VPN Manager
description: |
 The Shrew Soft VPN Client is a free IPsec VPN Client for FreeBSD, NetBSD,
 Linux and Windows operating systems. This product can be used to communicate
 with Open Source VPN servers (e.g. ipsec-tools) as well as some commercial
 VPN servers.
 .
 This package provides the connection manager program, which allows one
 to create, manage and use VPN connections.

grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots

apps:
  ikec:
    command: /usr/bin/ikec
  iked:
    daemon: simple
    command: /usr/sbin/iked
  qikea:
    command: /usr/bin/qikea
  qikec:
    command: /usr/bin/qikec

parts:
  ike:
    build-packages: ["libssl-dev","libedit-dev", "flex", "bison", "qt4-qmake", "qt4-default"]
    source: /home/snap/Documents/ike
    plugin: cmake
    configflags: ["-DCMAKE_INSTALL_PREFIX=/usr -DQTGUI=YES -DETCDIR=/etc -DNATT=YES"]
1 Like