Advertisement
FlyFar

configure.ac

Feb 8th, 2024
785
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
autoconf 3.13 KB | Cybersecurity | 0 0
  1. #
  2. # configure.ac
  3. #
  4. # Authors:
  5. #   Eric Butler <eric@codebutler.com>
  6. #   Nick Kossifidis <mickflemm@gmail.com>
  7. #
  8. #  This file is part of Firesheep.
  9. #
  10. #  This program is free software: you can redistribute it and/or modify
  11. #  it under the terms of the GNU General Public License as published by
  12. #  the Free Software Foundation, either version 3 of the License, or
  13. #  (at your option) any later version.
  14. #
  15. #  This program is distributed in the hope that it will be useful,
  16. #  but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18. #  GNU General Public License for more details.
  19. #
  20. #  You should have received a copy of the GNU General Public License
  21. #  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  22.  
  23. AC_INIT([Firesheep], [0.1], [eric@codebutler.com],
  24.         [firesheep], [http://codebutler.github.com/firesheep])
  25. AC_PROG_CC([clang gcc])
  26. AC_PREREQ([2.61])
  27. AM_INIT_AUTOMAKE([foreign])
  28.  
  29. AC_PROG_LIBTOOL
  30. AC_PROG_CXX([clang++ g++])
  31.  
  32. # A common source of problems.
  33. if test ! -d backend/deps/http-parser; then
  34.     AC_MSG_ERROR([http-parser missing, did you read the README?])
  35. fi
  36.  
  37. # OSX doesn't come with pkg-config, but PKG_CHECK_MODULES has to be defined to something to avoid errors.
  38. m4_define_default([PKG_CHECK_MODULES], [AC_MSG_FAILURE([pkg-config was not found])])
  39.  
  40. AC_CANONICAL_HOST
  41. AC_CANONICAL_TARGET
  42.  
  43. case "$build_cpu" in
  44.     i[[3456]]86*)
  45.         build_arch="x86"
  46.         ;;
  47.     amd64*|x86_64*)
  48.         build_arch="x86_64"
  49.         ;;
  50. esac
  51.  
  52. case "$host_os" in
  53.     cygwin)
  54.         DLL_EXT="dll"
  55.         FIRESHEEP_PLATFORM_NAME=WIN32
  56.         FIRESHEEP_PLATFORM="WINNT_x86-msvc"
  57.     ;;
  58.     darwin*)
  59.         DLL_EXT="dylib"
  60.         FIRESHEEP_PLATFORM_NAME=OSX
  61.         FIRESHEEP_PLATFORM="osx"
  62.         CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.6"
  63.     ;;
  64.     linux*)
  65.         DLL_EXT="so"
  66.         FIRESHEEP_PLATFORM_NAME=LINUX
  67.         FIRESHEEP_PLATFORM="Linux_${build_arch}-gcc3"
  68.     ;;
  69. esac
  70.  
  71. AC_SUBST(DLL_EXT)
  72. AC_SUBST(FIRESHEEP_PLATFORM)
  73. AC_SUBST(FIRESHEEP_PLATFORM_NAME)
  74.  
  75. AM_CONDITIONAL(PLATFORM_WIN32, test x$FIRESHEEP_PLATFORM_NAME = xWIN32)
  76. AM_CONDITIONAL(PLATFORM_OSX, test x$FIRESHEEP_PLATFORM_NAME = xOSX)
  77. AM_CONDITIONAL(PLATFORM_LINUX, test x$FIRESHEEP_PLATFORM_NAME = xLINUX)
  78.  
  79. # BEGIN PCAP LIBS
  80. AC_PATH_PROG([PCAP_CONFIG], [pcap-config], [no], [$PATH])
  81. if test "x$PCAP_CONFIG" = "xno"; then
  82.     AC_MSG_ERROR([pcap-config not found (libpcap not installed ?)])
  83. fi
  84.  
  85. PCAP_LIBS=`pcap-config --libs`
  86. AC_SUBST(PCAP_LIBS)
  87. PCAP_CFLAGS=`pcap-config --cflags`
  88. AC_SUBST(PCAP_FLAGS)
  89. # END PCAP LIBS
  90.  
  91. # BEGIN BOOST LIBS
  92. # Specific version ?
  93. #BOOST_REQUIRE([1.40])
  94. BOOST_REQUIRE
  95. AC_SUBST(BOOST_CPPFLAGS)
  96. BOOST_FORMAT
  97. AC_SUBST(BOOST_FORMAT_LIBS)
  98. BOOST_STRING_ALGO
  99. AC_SUBST(BOOST_STRING_ALGO_LIBS)
  100. # END BOOST LIBS
  101.  
  102. if test x$FIRESHEEP_PLATFORM_NAME = xLINUX; then
  103.     PKG_CHECK_MODULES(UDEV, [libudev])
  104.     AC_SUBST(UDEV_CFLAGS)
  105.     AC_SUBST(UDEV_LIBS)
  106. fi
  107.  
  108. CXXFLAGS="-Wall -g -O0"
  109. AC_SUBST(CXXFLAGS)
  110.  
  111. AC_CONFIG_FILES([
  112. Makefile
  113. backend/Makefile
  114. ])
  115.  
  116. AC_OUTPUT
  117.  
  118. echo "
  119. Firesheep-$VERSION
  120.  
  121.    Platform:  ${FIRESHEEP_PLATFORM}
  122. "
Tags: ac autoconf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement