[SOLVED] Makefile.am & Configure.ac 질문있습니다.

owcred601의 이미지

Configure.ac 와 Makefile.am 으로 Makefile을 만들 때, config.h 가 생성되는데, 그게 기존 헤더파일을 덮어써서,
찾을 수 없기 때문에 발생했던 에러네요..

답변해주신 분 정말 감사합니다.

-------------------------------------------------------------------------------------------
안녕하세요. Makefile.am 과 Configure.ac 이 처음이라, 구글에서 찾아서 따라서 작성해봤습니다.

이미 빌드가 완성된 프로그램의 것을 비교해보려고 했는데, 전부 C로 되어있어서, 혹시 빠진게 있나 알기 쉽지 않네요.
에러가 발생하는게 혹시 작성한 Configure.ac와 Makefile.am 이 문제인 것 같기도 합니다.

Makefile 자체는 만들어졌는데, 아래와 같은 에러가 발생해서.. 어딘가 잘못 작성했나 싶습니다.

| cryptlib.h:110:30: error: expected initializer before ':' token
|  class CRYPTOPP_DLL Exception : public std::exception
|                               ^
| In file included from crc.h:4:0,
|                  from crc.cpp:4:
| cryptlib.h:85:16: error: expected constructor, destructor, or type conversion before '(' token
|  NAMESPACE_BEGIN(CryptoPP)

Makefile.am >>

ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = foreign
 
LOCAL_CPPFLAGS := -DNDEBUG -O3
LOCAL_CPPFLAGS += -fPIC -ffunction-sections -fdata-sections -Os
LOCAL_CPPFLAGS += -pipe
 
AM_CPPFLAGS = -D__packed__= \
        $(LOCAL_CPPFLAGS) @GLIB_CFLAGS@
AM_CPPFLAGS += "-std=c++0x"
 
LOCAL_SRC_FILES := randool.cpp 등 CPP 파일이 위치해있습니다. 너무 길어서 생략하겠습니다.
 
LOCAL_HEADER_FILES := eprecomp.h 등 HEADER 파일이 위치해있습니다. 너무 길어서 생략하겠습니다.
 
library_includedir = $(pkgincludedir)
library_include_HEADERS = $(LOCAL_HEADER_FILES)
 
lib_LTLIBRARIES = libcryptopp.la
libcryptopp_la_CXX = @CXX@
libcryptopp_la_SOURCES = $(LOCAL_SRC_FILES)
 
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libcryptopp.pc
EXTRA_DIST = $(pkgconfig_DATA)
 
include $(BUILD_SHARED_LIBRARY)
 
libcryptopp_la_CPPFLAGS = -DUSE_GLIB -std=c++0x $(AM_CPPFLAGS)
libcryptopp_la_LDFLAGS = -g -Wl,--gc-sections -lpthread -ldl @GLIB_LIBS@
libcryptopp_la_LIBADD = -lpthread -ldl

-------
Configure.ac >>

AC_PREREQ(2.65)
AC_INIT([libcryptopp], 1.0.0)
AM_INIT_AUTOMAKE([-Wall gnu foreign])
AM_MAINTAINER_MODE
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
 
# Check for programs
AC_PROG_CXX
AM_PROG_AS
AC_PROG_LIBTOOL
AC_PROG_INSTALL
 
PKG_PROG_PKG_CONFIG
 
AC_ARG_WITH(sanitized-headers,
        AS_HELP_STRING([--with-sanitized-headers=DIR],
                [Specify the location of the sanitized Linux headers]),
        [CPPFLAGS="$CPPFLAGS -idirafter $withval"])
 
AC_ARG_WITH([glib],
        AC_HELP_STRING([--with-glib],
                [enable glib, building HLOS systems which use glib]))
 
if (test "x${with_glib}" = "xyes"); then
        AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib])
        PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
        AC_MSG_ERROR(GThread >= 2.16 is required))
        PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
        AC_MSG_ERROR(GLib >= 2.16 is required))
        GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
        GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
        AC_SUBST(GLIB_CFLAGS)
        AC_SUBST(GLIB_LIBS)
fi
 
AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes")
 
AC_SUBST([CFLAGS])
AC_SUBST([CPPFLAGS])
AC_SUBST([CC])
AC_SUBST([CXX])
 
AC_CONFIG_FILES([ \
        Makefile \
        libcryptopp.pc
        ])
AC_OUTPUT

입니다.

읽어주셔서 감사합니다.

Anti-Lock의 이미지

CRYPTOPP_DLL 를 지정하는 컴파일 플래그가 누락되어 그런것 같습니다.
혹은 config.h 같은 파일이 잘못 만들어 졌거나요.

owcred601의 이미지

CRYPTOPP_DLL 을 define 해주는 부분이 있는데, #define CRYPTOPP_DLL 로만 정의되있는 부분을 타게 되어있습니다.
이렇게 되면 빈칸으로 되어서 문제 없지 않을까요?

기존 리눅스 환경에서 빌드했을 때, 문제가 없었는데, 새로 보드에 옮기면서 다음같은 에러가 발생한 경우라서..
혹시 저런 에러가 발생하면 CPP 컴파일 자체가 먹히지 않았다고도 볼 수 있을까요??

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.