Skip to content

Commit

Permalink
Move autotools build to CMake.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolf3s committed Jul 13, 2024
1 parent 46f563d commit a039c02
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 301 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ jobs:
run: |
sudo apt update
sudo apt install -y libkrb5-dev
- name: configure
- name: CMake configure
run: |
./bootstrap
./configure
- name: make
run: make
- name: make distcheck
run: make distcheck
cmake -S . -B build
- name: Build (Linux)
run: cmake --build build

build-windows:
name: Windows build
Expand All @@ -30,7 +29,7 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: Cmake configure
- name: CMake configure
run: |
cmake -G "Visual Studio 17 2022" .
- name: Build (MSVC)
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ jobs:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Build CMake
run: |
cmake -S . -B build
cmake --build build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
Expand Down
25 changes: 23 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(NOT ESP_PLATFORM)

if(CMAKE_SYSTEM_NAME MATCHES NintendoSwitch OR CMAKE_SYSTEM_NAME MATCHES Nintendo3DS OR CMAKE_SYSTEM_NAME MATCHES Dreamcast OR CMAKE_SYSTEM_NAME MATCHES NintendoGameCube OR CMAKE_SYSTEM_NAME MATCHES NintendoDS OR CMAKE_SYSTEM_NAME MATCHES NintendoWii OR CMAKE_SYSTEM_NAME MATCHES CafeOS)
cmake_minimum_required(VERSION 3.13)
elseif(VITA)
Expand All @@ -10,21 +11,41 @@ if(NOT ESP_PLATFORM)
cmake_minimum_required(VERSION 3.5)
endif()

if(IOP AND BUILD_IRX)
if(NOT IOP AND BUILD_IRX)
project(smb2man
LANGUAGES C
VERSION 4.0.0
VERSION 2.2.0
)
set(VERSION 2.2.0)
set(PACKAGE "smb2man")
set(PACKAGE_BUGREPORT "[email protected] or [email protected]")
set(PACKAGE_NAME "smb2man")
set(PACKAGE_VERSION "${VERSION}")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_TARNAME "${PACKAGE}")
set(PACKAGE_URL "https://github.com/sahlberg/libsmb2")

elseif(PICO_BOARD)
project(libsmb2 C CXX ASM)
else()
project(libsmb2
LANGUAGES C
VERSION 4.0.0
)
set(VERSION 4.0.0)
set(PACKAGE "libsmb2")
set(PACKAGE_BUGREPORT "[email protected]")
set(PACKAGE_NAME "libsmb2")
set(PACKAGE_VERSION "${VERSION}")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_TARNAME "${PACKAGE}")
set(PACKAGE_URL "https://github.com/sahlberg/libsmb2")
endif()
configure_file(libsmb2.pc.in libsmb2.pc @ONLY)

endif()


if(NOT PICO_BOARD OR NOT ESP_PLATFORM)
set(SOVERSION 1 CACHE STRING "" FORCE)
if(NOT IOP AND NOT BUILD_IRX)
Expand Down
12 changes: 0 additions & 12 deletions Makefile.am

This file was deleted.

2 changes: 0 additions & 2 deletions bootstrap

This file was deleted.

88 changes: 56 additions & 32 deletions cmake/config.h.cmake
Original file line number Diff line number Diff line change
@@ -1,99 +1,123 @@
/* config.h.cmake */

/* Define to 1 if you have the <arpa/inet.h> header file. */
#cmakedefine HAVE_ARPA_INET_H
#cmakedefine HAVE_ARPA_INET_H "@HAVE_ARPA_INET_H@"

/* Define to 1 if you have the <dlfcn.h> header file. */
#cmakedefine HAVE_DLFCN_H
#cmakedefine HAVE_DLFCN_H "@HAVE_DLFCN_H@"

/* Define to 1 if you have the <fcntl.h> header file. */
#cmakedefine HAVE_FCNTL_H
#cmakedefine HAVE_FCNTL_H "@HAVE_FCNTL_H@"

/* Define to 1 if you have the <sys/fcntl.h> header file. */
#cmakedefine HAVE_SYS_FCNTL_H
#cmakedefine HAVE_SYS_FCNTL_H "@HAVE_SYS_FCNTL_H@"

/* Define to 1 if you have the <gssapi/gssapi.h> header file. */
#cmakedefine HAVE_GSSAPI_GSSAPI_H
#cmakedefine HAVE_GSSAPI_GSSAPI_H "@HAVE_GSSAPI_GSSAPI_H@"

/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H
#cmakedefine HAVE_INTTYPES_H "@HAVE_INTTYPES_H@"

/* Define to 1 if you have the <netdb.h> header file. */
#cmakedefine HAVE_NETDB_H
#cmakedefine HAVE_NETDB_H "@HAVE_NETDB_H@"

/* Define to 1 if you have the <netinet/in.h> header file. */
#cmakedefine HAVE_NETINET_IN_H
#cmakedefine HAVE_NETINET_IN_H "@HAVE_NETINET_IN_H@"

/* Define to 1 if you have the <netinet/tcp.h> header file. */
#cmakedefine HAVE_NETINET_TCP_H
#cmakedefine HAVE_NETINET_TCP_H "@HAVE_NETINET_TCP_H@"

/* Define to 1 if you have the <poll.h> header file. */
#cmakedefine HAVE_POLL_H
#cmakedefine HAVE_POLL_H "@HAVE_POLL_H@"

/* Whether sockaddr struct has sa_len */
#cmakedefine HAVE_SOCKADDR_LEN
#cmakedefine HAVE_SOCKADDR_LEN "@HAVE_SOCKADDR_LEN@"

/* Whether we have sockaddr_Storage */
#cmakedefine HAVE_SOCKADDR_STORAGE
#cmakedefine HAVE_SOCKADDR_STORAGE "@HAVE_SOCKADDR_STORAGE@"

/* Whether we have linger */
#cmakedefine HAVE_LINGER
#cmakedefine HAVE_LINGER "@HAVE_LINGER@"

/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H
#cmakedefine HAVE_STDINT_H "@HAVE_STDINT_H@"

/* Define to 1 if you have the <stdio.h> header file. */
#cmakedefine HAVE_STDIO_H
#cmakedefine HAVE_STDIO_H "@HAVE_STDIO_H@"

/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine HAVE_STDLIB_H
#cmakedefine HAVE_STDLIB_H "@HAVE_STDLIB_H@"

/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine HAVE_STRINGS_H
#cmakedefine HAVE_STRINGS_H "@HAVE_STRINGS_H@"

/* Define to 1 if you have the <string.h> header file. */
#cmakedefine HAVE_STRING_H
#cmakedefine HAVE_STRING_H "@HAVE_STRING_H@"

/* Define to 1 if you have the <sys/ioctl.h> header file. */
#cmakedefine HAVE_SYS_IOCTL_H
#cmakedefine HAVE_SYS_IOCTL_H "@HAVE_SYS_IOCTL_H@"

/* Define to 1 if you have the <sys/poll.h> header file. */
#cmakedefine HAVE_SYS_POLL_H
#cmakedefine HAVE_SYS_POLL_H "@HAVE_SYS_POLL_H@"

/* Define to 1 if you have the <sys/socket.h> header file. */
#cmakedefine HAVE_SYS_SOCKET_H
#cmakedefine HAVE_SYS_SOCKET_H "@HAVE_SYS_SOCKET_H@"

/* Define to 1 if you have the <sys/stat.h> header file. */
#cmakedefine HAVE_SYS_STAT_H
#cmakedefine HAVE_SYS_STAT_H "@HAVE_SYS_STAT_H@"

/* Define to 1 if you have the <sys/types.h> header file. */
#cmakedefine HAVE_SYS_TYPES_H
#cmakedefine HAVE_SYS_TYPES_H "@HAVE_SYS_TYPES_H@"

/* Define to 1 if you have the <sys/uio.h> header file. */
#cmakedefine HAVE_SYS_UIO_H
#cmakedefine HAVE_SYS_UIO_H "@HAVE_SYS_UIO_H@"

/* Define to 1 if you have the <sys/_iovec.h> header file. */
#cmakedefine HAVE_SYS__IOVEC_H
#cmakedefine HAVE_SYS__IOVEC_H "@HAVE_SYS__IOVEC_H@"

/* Define to 1 if you have the <time.h> header file. */
#cmakedefine HAVE_TIME_H
#cmakedefine HAVE_TIME_H "@HAVE_TIME_H@"

/* Define to 1 if you have the <sys/time.h> header file. */
#cmakedefine HAVE_SYS_TIME_H
#cmakedefine HAVE_SYS_TIME_H "@HAVE_SYS_TIME_H@"

/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine HAVE_UNISTD_H
#cmakedefine HAVE_UNISTD_H "@HAVE_UNISTD_H@"

/* Define to 1 if you have the <sys/unistd.h> header file. */
#cmakedefine HAVE_SYS_UNISTD_H
#cmakedefine HAVE_SYS_UNISTD_H "@HAVE_SYS_UNISTD_H@"

/* Define to 1 if you have the <errno.h> header file. */
#cmakedefine HAVE_ERRNO_H
#cmakedefine HAVE_ERRNO_H "@HAVE_ERRNO_H@"

/* Define to 1 if you have the <sys/errno.h> header file. */
#cmakedefine HAVE_SYS_ERRNO_H
#cmakedefine HAVE_SYS_ERRNO_H "@HAVE_SYS_ERRNO_H@"

/* Define to 1 if all of the C90 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
#cmakedefine STDC_HEADERS
#cmakedefine STDC_HEADERS "@STDC_HEADERS@"

/* Name of package */
#cmakedefine PACKAGE "@PACKAGE@"

/* Define to the address where bug reports for this package should be sent. */
#cmakedefine PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"

/* Define to the full name of this package. */
#cmakedefine PACKAGE_NAME "@PACKAGE_NAME@"

/* Define to the full name and version of this package. */
#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@"

/* Define to the one symbol short name of this package. */
#cmakedefine PACKAGE_TARNAME "@PACKAGE_TARNAME@"

/* Define to the home page for this package. */
#cmakedefine PACKAGE_URL "@PACKAGE_URL@"

/* Define to the version of this package. */
#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@"

/* Version number of package */
#cmakedefine VERSION "@VERSION@"
Loading

0 comments on commit a039c02

Please sign in to comment.