specifed CGO_CFLAGS and CGO_LDFLAGS in Makefile.am
All checks were successful
continuous-integration/drone/push Build is passing

removed ##cgo CFLAGS and #cgo LDFLAGS from go source files
This commit is contained in:
hyung-hwan 2023-10-30 02:30:19 +09:00
parent 5a1fd8f130
commit a7b323b795
5 changed files with 10 additions and 14 deletions

View File

@ -48,6 +48,8 @@ hclgo.bin:
sed -ri "/^[[:space:]]*replace[[:space:]]+cfg[[:space:]]*=>/d" $(builddir)/go.mod sed -ri "/^[[:space:]]*replace[[:space:]]+cfg[[:space:]]*=>/d" $(builddir)/go.mod
echo -e "\nreplace cfg => $(abs_builddir)/go/cfg" >> $(builddir)/go.mod echo -e "\nreplace cfg => $(abs_builddir)/go/cfg" >> $(builddir)/go.mod
[ -f $(srcdir)/go.sum ] && cp -pf $(srcdir)/go.sum $(builddir)/go.sum >/dev/null 2>&1 || true [ -f $(srcdir)/go.sum ] && cp -pf $(srcdir)/go.sum $(builddir)/go.sum >/dev/null 2>&1 || true
CGO_CFLAGS="-I$(abs_srcdir)/lib -I$(abs_builddir)/lib $(CFLAGS)" \
CGO_LDFLAGS="-L$(abs_builddir)/lib -L$(abs_builddir)/lib/.libs -lhcl -ldl -lquadmath" \
go build -C $(srcdir) -x -o $(abs_builddir)/hclgo.bin -modfile $(abs_builddir)/go.mod go build -C $(srcdir) -x -o $(abs_builddir)/hclgo.bin -modfile $(abs_builddir)/go.mod
go clean -C $(srcdir) -x -modfile $(abs_builddir)/go.mod go clean -C $(srcdir) -x -modfile $(abs_builddir)/go.mod
rm -rf $(builddir)/go.mod $(builddir)/go.sum rm -rf $(builddir)/go.mod $(builddir)/go.sum

View File

@ -943,6 +943,8 @@ clean-local:
@ENABLE_HCLGO_TRUE@ sed -ri "/^[[:space:]]*replace[[:space:]]+cfg[[:space:]]*=>/d" $(builddir)/go.mod @ENABLE_HCLGO_TRUE@ sed -ri "/^[[:space:]]*replace[[:space:]]+cfg[[:space:]]*=>/d" $(builddir)/go.mod
@ENABLE_HCLGO_TRUE@ echo -e "\nreplace cfg => $(abs_builddir)/go/cfg" >> $(builddir)/go.mod @ENABLE_HCLGO_TRUE@ echo -e "\nreplace cfg => $(abs_builddir)/go/cfg" >> $(builddir)/go.mod
@ENABLE_HCLGO_TRUE@ [ -f $(srcdir)/go.sum ] && cp -pf $(srcdir)/go.sum $(builddir)/go.sum >/dev/null 2>&1 || true @ENABLE_HCLGO_TRUE@ [ -f $(srcdir)/go.sum ] && cp -pf $(srcdir)/go.sum $(builddir)/go.sum >/dev/null 2>&1 || true
@ENABLE_HCLGO_TRUE@ CGO_CFLAGS="-I$(abs_srcdir)/lib -I$(abs_builddir)/lib $(CFLAGS)" \
@ENABLE_HCLGO_TRUE@ CGO_LDFLAGS="-L$(abs_builddir)/lib -L$(abs_builddir)/lib/.libs -lhcl -ldl -lquadmath" \
@ENABLE_HCLGO_TRUE@ go build -C $(srcdir) -x -o $(abs_builddir)/hclgo.bin -modfile $(abs_builddir)/go.mod @ENABLE_HCLGO_TRUE@ go build -C $(srcdir) -x -o $(abs_builddir)/hclgo.bin -modfile $(abs_builddir)/go.mod
@ENABLE_HCLGO_TRUE@ go clean -C $(srcdir) -x -modfile $(abs_builddir)/go.mod @ENABLE_HCLGO_TRUE@ go clean -C $(srcdir) -x -modfile $(abs_builddir)/go.mod
@ENABLE_HCLGO_TRUE@ rm -rf $(builddir)/go.mod $(builddir)/go.sum @ENABLE_HCLGO_TRUE@ rm -rf $(builddir)/go.mod $(builddir)/go.sum

View File

@ -1,26 +1,24 @@
package hcl package hcl
/* /*
#cgo CFLAGS: -I/home/hyung-hwan/xxx/include -g -Wall
#cgo LDFLAGS: -L/home/hyung-hwan/xxx/lib -lhcl -ldl -lquadmath
#include <hcl.h> #include <hcl.h>
#include <hcl-utl.h> #include <hcl-utl.h>
*/ */
import "C" import "C"
import ( import (
// "bufio" // "bufio"
// "io" // "io"
"os" "os"
// "sync" // "sync"
// "unsafe" // "unsafe"
) )
type IOHandle struct { type IOHandle struct {
file *os.File file *os.File
ioif interface{} ioif interface{}
} }
/* /*
type IOHandleTable struct { type IOHandleTable struct {
mtx sync.Mutex mtx sync.Mutex
@ -408,7 +406,7 @@ func (p *PrintFileHandler) Open(g *HCL) error {
f *os.File f *os.File
// err error // err error
) )
// f, err = os.OpenFile("/dev/stdout", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) // f, err = os.OpenFile("/dev/stdout", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
// if err != nil { // if err != nil {
// return err // return err

View File

@ -1,9 +1,6 @@
package hcl package hcl
/* /*
#cgo CFLAGS: -I/home/hyung-hwan/xxx/include -g -Wall
#cgo LDFLAGS: -L/home/hyung-hwan/xxx/lib -lhcl -ldl -lquadmath
#include <hcl.h> #include <hcl.h>
#include <hcl-utl.h> #include <hcl-utl.h>
*/ */

View File

@ -1,9 +1,6 @@
package hcl package hcl
/* /*
#cgo CFLAGS: -I/home/hyung-hwan/xxx/include -g -Wall
#cgo LDFLAGS: -L/home/hyung-hwan/xxx/lib -lhcl -ldl -lquadmath
#include <hcl.h> #include <hcl.h>
*/ */
import "C" import "C"